Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 1 | # $Id: configure.ac,v 1.583 2014/08/26 20:32:01 djm Exp $ |
Damien Miller | 4fefe24 | 2004-03-11 14:20:10 +1100 | [diff] [blame] | 2 | # |
| 3 | # Copyright (c) 1999-2004 Damien Miller |
| 4 | # |
| 5 | # Permission to use, copy, modify, and distribute this software for any |
| 6 | # purpose with or without fee is hereby granted, provided that the above |
| 7 | # copyright notice and this permission notice appear in all copies. |
| 8 | # |
| 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
Damien Miller | e9cf357 | 2001-02-09 12:55:35 +1100 | [diff] [blame] | 16 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 17 | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) |
Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 18 | AC_REVISION($Revision: 1.583 $) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 19 | AC_CONFIG_SRCDIR([ssh.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 20 | AC_LANG([C]) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 21 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 22 | AC_CONFIG_HEADER([config.h]) |
Damien Miller | 856799b | 2000-03-15 21:18:10 +1100 | [diff] [blame] | 23 | AC_PROG_CC |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 24 | AC_CANONICAL_HOST |
Damien Miller | 4df5c76 | 2001-02-28 08:14:22 +1100 | [diff] [blame] | 25 | AC_C_BIGENDIAN |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 26 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 27 | # Checks for programs. |
Darren Tucker | 167bd9c | 2003-09-07 12:34:54 +1000 | [diff] [blame] | 28 | AC_PROG_AWK |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 29 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 30 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 31 | AC_PROG_INSTALL |
Tim Rice | fd80ddc | 2006-02-02 19:11:56 -0800 | [diff] [blame] | 32 | AC_PROG_EGREP |
Darren Tucker | 408f4c2 | 2015-04-17 09:39:58 +1000 | [diff] [blame] | 33 | AC_CHECK_TOOLS([AR], [ar]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 34 | AC_PATH_PROG([CAT], [cat]) |
| 35 | AC_PATH_PROG([KILL], [kill]) |
| 36 | AC_PATH_PROGS([PERL], [perl5 perl]) |
| 37 | AC_PATH_PROG([SED], [sed]) |
| 38 | AC_SUBST([PERL]) |
| 39 | AC_PATH_PROG([ENT], [ent]) |
| 40 | AC_SUBST([ENT]) |
| 41 | AC_PATH_PROG([TEST_MINUS_S_SH], [bash]) |
| 42 | AC_PATH_PROG([TEST_MINUS_S_SH], [ksh]) |
| 43 | AC_PATH_PROG([TEST_MINUS_S_SH], [sh]) |
| 44 | AC_PATH_PROG([SH], [sh]) |
| 45 | AC_PATH_PROG([GROFF], [groff]) |
| 46 | AC_PATH_PROG([NROFF], [nroff]) |
| 47 | AC_PATH_PROG([MANDOC], [mandoc]) |
| 48 | AC_SUBST([TEST_SHELL], [sh]) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 49 | |
Damien Miller | 30a69e7 | 2011-01-04 08:16:27 +1100 | [diff] [blame] | 50 | dnl select manpage formatter |
| 51 | if test "x$MANDOC" != "x" ; then |
| 52 | MANFMT="$MANDOC" |
| 53 | elif test "x$NROFF" != "x" ; then |
| 54 | MANFMT="$NROFF -mandoc" |
| 55 | elif test "x$GROFF" != "x" ; then |
| 56 | MANFMT="$GROFF -mandoc -Tascii" |
| 57 | else |
| 58 | AC_MSG_WARN([no manpage formatted found]) |
| 59 | MANFMT="false" |
| 60 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 61 | AC_SUBST([MANFMT]) |
Damien Miller | 30a69e7 | 2011-01-04 08:16:27 +1100 | [diff] [blame] | 62 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 63 | dnl for buildpkg.sh |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 64 | AC_PATH_PROG([PATH_GROUPADD_PROG], [groupadd], [groupadd], |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 65 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 66 | AC_PATH_PROG([PATH_USERADD_PROG], [useradd], [useradd], |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 67 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 68 | AC_CHECK_PROG([MAKE_PACKAGE_SUPPORTED], [pkgmk], [yes], [no]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 69 | if test -x /sbin/sh; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 70 | AC_SUBST([STARTUP_SCRIPT_SHELL], [/sbin/sh]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 71 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 72 | AC_SUBST([STARTUP_SCRIPT_SHELL], [/bin/sh]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 73 | fi |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 74 | |
Damien Miller | e8bb450 | 2001-09-25 16:39:35 +1000 | [diff] [blame] | 75 | # System features |
| 76 | AC_SYS_LARGEFILE |
| 77 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 78 | if test -z "$AR" ; then |
| 79 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 80 | fi |
| 81 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 82 | AC_PATH_PROG([PATH_PASSWD_PROG], [passwd]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 83 | if test ! -z "$PATH_PASSWD_PROG" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 84 | AC_DEFINE_UNQUOTED([_PATH_PASSWD_PROG], ["$PATH_PASSWD_PROG"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 85 | [Full path of your "passwd" program]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 86 | fi |
| 87 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 88 | if test -z "$LD" ; then |
| 89 | LD=$CC |
| 90 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 91 | AC_SUBST([LD]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 92 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 93 | AC_C_INLINE |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 94 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 95 | AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 96 | AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [ |
| 97 | #include <sys/types.h> |
| 98 | #include <sys/param.h> |
| 99 | #include <dev/systrace.h> |
| 100 | ]) |
| 101 | AC_CHECK_DECL([RLIMIT_NPROC], |
| 102 | [AC_DEFINE([HAVE_RLIMIT_NPROC], [], [sys/resource.h has RLIMIT_NPROC])], , [ |
| 103 | #include <sys/types.h> |
| 104 | #include <sys/resource.h> |
| 105 | ]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 106 | AC_CHECK_DECL([PR_SET_NO_NEW_PRIVS], [have_linux_no_new_privs=1], , [ |
| 107 | #include <sys/types.h> |
| 108 | #include <linux/prctl.h> |
| 109 | ]) |
Damien Miller | 868ea1e | 2014-01-17 16:47:04 +1100 | [diff] [blame] | 110 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 111 | openssl=yes |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 112 | AC_ARG_WITH([openssl], |
| 113 | [ --without-openssl Disable use of OpenSSL; use only limited internal crypto **EXPERIMENTAL** ], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 114 | [ if test "x$withval" = "xno" ; then |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 115 | openssl=no |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 116 | fi |
| 117 | ] |
| 118 | ) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 119 | AC_MSG_CHECKING([whether OpenSSL will be used for cryptography]) |
| 120 | if test "x$openssl" = "xyes" ; then |
| 121 | AC_MSG_RESULT([yes]) |
| 122 | AC_DEFINE_UNQUOTED([WITH_OPENSSL], [1], [use libcrypto for cryptography]) |
| 123 | else |
| 124 | AC_MSG_RESULT([no]) |
| 125 | fi |
| 126 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 127 | use_stack_protector=1 |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 128 | use_toolchain_hardening=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 129 | AC_ARG_WITH([stackprotect], |
Damien Miller | da3155e | 2008-03-27 12:30:18 +1100 | [diff] [blame] | 130 | [ --without-stackprotect Don't use compiler's stack protection], [ |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 131 | if test "x$withval" = "xno"; then |
| 132 | use_stack_protector=0 |
| 133 | fi ]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 134 | AC_ARG_WITH([hardening], |
| 135 | [ --without-hardening Don't use toolchain hardening flags], [ |
| 136 | if test "x$withval" = "xno"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 137 | use_toolchain_hardening=0 |
| 138 | fi ]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 139 | |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 140 | # We use -Werror for the tests only so that we catch warnings like "this is |
| 141 | # on by default" for things like -fPIE. |
| 142 | AC_MSG_CHECKING([if $CC supports -Werror]) |
| 143 | saved_CFLAGS="$CFLAGS" |
| 144 | CFLAGS="$CFLAGS -Werror" |
| 145 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], |
| 146 | [ AC_MSG_RESULT([yes]) |
| 147 | WERROR="-Werror"], |
| 148 | [ AC_MSG_RESULT([no]) |
| 149 | WERROR="" ] |
| 150 | ) |
| 151 | CFLAGS="$saved_CFLAGS" |
Damien Miller | 134d02a | 2011-01-12 16:00:37 +1100 | [diff] [blame] | 152 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 153 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
Darren Tucker | d904886 | 2017-03-31 11:04:43 +1100 | [diff] [blame] | 154 | OSSH_CHECK_CFLAG_COMPILE([-pipe]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 155 | OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) |
| 156 | OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option]) |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 157 | OSSH_CHECK_CFLAG_COMPILE([-Wall]) |
| 158 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) |
| 159 | OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) |
| 160 | OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) |
| 161 | OSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) |
Darren Tucker | abbc7a7 | 2013-05-10 13:54:23 +1000 | [diff] [blame] | 162 | OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 163 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) |
| 164 | OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) |
| 165 | OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) |
Darren Tucker | 4a725ef | 2011-11-21 16:38:48 +1100 | [diff] [blame] | 166 | OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 167 | if test "x$use_toolchain_hardening" = "x1"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 168 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,relro]) |
| 169 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,now]) |
| 170 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,noexecstack]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 171 | # NB. -ftrapv expects certain support functions to be present in |
| 172 | # the compiler library (libgcc or similar) to detect integer operations |
| 173 | # that can overflow. We must check that the result of enabling it |
| 174 | # actually links. The test program compiled/linked includes a number |
| 175 | # of integer operations that should exercise this. |
| 176 | OSSH_CHECK_CFLAG_LINK([-ftrapv]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 177 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 178 | AC_MSG_CHECKING([gcc version]) |
Darren Tucker | 3f9545e | 2005-11-12 15:20:52 +1100 | [diff] [blame] | 179 | GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 180 | case $GCC_VER in |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 181 | 1.*) no_attrib_nonnull=1 ;; |
| 182 | 2.8* | 2.9*) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 183 | no_attrib_nonnull=1 |
| 184 | ;; |
| 185 | 2.*) no_attrib_nonnull=1 ;; |
Darren Tucker | f032435 | 2005-11-10 21:30:36 +1100 | [diff] [blame] | 186 | *) ;; |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 187 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 188 | AC_MSG_RESULT([$GCC_VER]) |
Damien Miller | de3cb0a | 2005-05-26 20:48:25 +1000 | [diff] [blame] | 189 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 190 | AC_MSG_CHECKING([if $CC accepts -fno-builtin-memset]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 191 | saved_CFLAGS="$CFLAGS" |
| 192 | CFLAGS="$CFLAGS -fno-builtin-memset" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 193 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> ]], |
| 194 | [[ char b[10]; memset(b, 0, sizeof(b)); ]])], |
| 195 | [ AC_MSG_RESULT([yes]) ], |
| 196 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 197 | CFLAGS="$saved_CFLAGS" ] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 198 | ) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 199 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 200 | # -fstack-protector-all doesn't always work for some GCC versions |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 201 | # 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] | 202 | # 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] | 203 | if test "x$use_stack_protector" = "x1"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 204 | for t in -fstack-protector-strong -fstack-protector-all \ |
| 205 | -fstack-protector; do |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 206 | AC_MSG_CHECKING([if $CC supports $t]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 207 | saved_CFLAGS="$CFLAGS" |
| 208 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 209 | CFLAGS="$CFLAGS $t -Werror" |
| 210 | LDFLAGS="$LDFLAGS $t -Werror" |
| 211 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 212 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 213 | [[ |
| 214 | char x[256]; |
| 215 | snprintf(x, sizeof(x), "XXX"); |
| 216 | ]])], |
| 217 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 218 | CFLAGS="$saved_CFLAGS $t" |
| 219 | LDFLAGS="$saved_LDFLAGS $t" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 220 | AC_MSG_CHECKING([if $t works]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 221 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 222 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 223 | [[ |
| 224 | char x[256]; |
| 225 | snprintf(x, sizeof(x), "XXX"); |
| 226 | ]])], |
| 227 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 228 | break ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 229 | [ AC_MSG_RESULT([no]) ], |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 230 | [ AC_MSG_WARN([cross compiling: cannot test]) |
| 231 | break ] |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 232 | ) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 233 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 234 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 235 | ) |
| 236 | CFLAGS="$saved_CFLAGS" |
| 237 | LDFLAGS="$saved_LDFLAGS" |
| 238 | done |
| 239 | fi |
Darren Tucker | 319b3d9 | 2007-12-02 21:02:22 +1100 | [diff] [blame] | 240 | |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 241 | if test -z "$have_llong_max"; then |
| 242 | # retry LLONG_MAX with -std=gnu99, needed on some Linuxes |
| 243 | unset ac_cv_have_decl_LLONG_MAX |
| 244 | saved_CFLAGS="$CFLAGS" |
| 245 | CFLAGS="$CFLAGS -std=gnu99" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 246 | AC_CHECK_DECL([LLONG_MAX], |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 247 | [have_llong_max=1], |
| 248 | [CFLAGS="$saved_CFLAGS"], |
| 249 | [#include <limits.h>] |
| 250 | ) |
| 251 | fi |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 252 | fi |
| 253 | |
Darren Tucker | 951b53b | 2013-02-08 11:50:09 +1100 | [diff] [blame] | 254 | AC_MSG_CHECKING([if compiler allows __attribute__ on return types]) |
| 255 | AC_COMPILE_IFELSE( |
| 256 | [AC_LANG_PROGRAM([[ |
| 257 | #include <stdlib.h> |
| 258 | __attribute__((__unused__)) static void foo(void){return;}]], |
| 259 | [[ exit(0); ]])], |
| 260 | [ AC_MSG_RESULT([yes]) ], |
| 261 | [ AC_MSG_RESULT([no]) |
| 262 | AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1, |
| 263 | [compiler does not accept __attribute__ on return types]) ] |
| 264 | ) |
| 265 | |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 266 | if test "x$no_attrib_nonnull" != "x1" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 267 | AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull]) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 268 | fi |
| 269 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 270 | AC_ARG_WITH([rpath], |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 271 | [ --without-rpath Disable auto-added -R linker paths], |
| 272 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 273 | if test "x$withval" = "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 274 | need_dash_r="" |
| 275 | fi |
| 276 | if test "x$withval" = "xyes" ; then |
| 277 | need_dash_r=1 |
| 278 | fi |
| 279 | ] |
| 280 | ) |
| 281 | |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 282 | # Allow user to specify flags |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 283 | AC_ARG_WITH([cflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 284 | [ --with-cflags Specify additional flags to pass to compiler], |
| 285 | [ |
| 286 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 287 | test "x${withval}" != "xyes"; then |
| 288 | CFLAGS="$CFLAGS $withval" |
| 289 | fi |
| 290 | ] |
| 291 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 292 | AC_ARG_WITH([cppflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 293 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 294 | [ |
| 295 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 296 | test "x${withval}" != "xyes"; then |
| 297 | CPPFLAGS="$CPPFLAGS $withval" |
| 298 | fi |
| 299 | ] |
| 300 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 301 | AC_ARG_WITH([ldflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 302 | [ --with-ldflags Specify additional flags to pass to linker], |
| 303 | [ |
| 304 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 305 | test "x${withval}" != "xyes"; then |
| 306 | LDFLAGS="$LDFLAGS $withval" |
| 307 | fi |
| 308 | ] |
| 309 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 310 | AC_ARG_WITH([libs], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 311 | [ --with-libs Specify additional libraries to link with], |
| 312 | [ |
| 313 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 314 | test "x${withval}" != "xyes"; then |
| 315 | LIBS="$LIBS $withval" |
| 316 | fi |
| 317 | ] |
| 318 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 319 | AC_ARG_WITH([Werror], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 320 | [ --with-Werror Build main code with -Werror], |
| 321 | [ |
| 322 | if test -n "$withval" && test "x$withval" != "xno"; then |
| 323 | werror_flags="-Werror" |
| 324 | if test "x${withval}" != "xyes"; then |
| 325 | werror_flags="$withval" |
| 326 | fi |
| 327 | fi |
| 328 | ] |
| 329 | ) |
| 330 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 331 | AC_CHECK_HEADERS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 332 | blf.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 333 | bstring.h \ |
| 334 | crypt.h \ |
| 335 | crypto/sha2.h \ |
| 336 | dirent.h \ |
| 337 | endian.h \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 338 | elf.h \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 339 | err.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 340 | features.h \ |
| 341 | fcntl.h \ |
| 342 | floatingpoint.h \ |
| 343 | getopt.h \ |
| 344 | glob.h \ |
| 345 | ia.h \ |
| 346 | iaf.h \ |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 347 | inttypes.h \ |
Darren Tucker | f3f2cc8 | 2016-07-11 17:23:38 +1000 | [diff] [blame] | 348 | langinfo.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 349 | limits.h \ |
Darren Tucker | ae133d4 | 2013-06-06 08:30:20 +1000 | [diff] [blame] | 350 | locale.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 351 | login.h \ |
| 352 | maillock.h \ |
| 353 | ndir.h \ |
| 354 | net/if_tun.h \ |
| 355 | netdb.h \ |
| 356 | netgroup.h \ |
| 357 | pam/pam_appl.h \ |
| 358 | paths.h \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 359 | poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 360 | pty.h \ |
| 361 | readpassphrase.h \ |
| 362 | rpc/types.h \ |
| 363 | security/pam_appl.h \ |
| 364 | sha2.h \ |
| 365 | shadow.h \ |
| 366 | stddef.h \ |
| 367 | stdint.h \ |
| 368 | string.h \ |
| 369 | strings.h \ |
| 370 | sys/audit.h \ |
| 371 | sys/bitypes.h \ |
| 372 | sys/bsdtty.h \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 373 | sys/capability.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 374 | sys/cdefs.h \ |
| 375 | sys/dir.h \ |
| 376 | sys/mman.h \ |
| 377 | sys/ndir.h \ |
Darren Tucker | 7c92a65 | 2007-09-27 07:00:09 +1000 | [diff] [blame] | 378 | sys/poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 379 | sys/prctl.h \ |
| 380 | sys/pstat.h \ |
Darren Tucker | 5ee3fb5 | 2016-11-01 08:12:33 +1100 | [diff] [blame] | 381 | sys/ptrace.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 382 | sys/select.h \ |
| 383 | sys/stat.h \ |
| 384 | sys/stream.h \ |
| 385 | sys/stropts.h \ |
| 386 | sys/strtio.h \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 387 | sys/statvfs.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 388 | sys/sysmacros.h \ |
| 389 | sys/time.h \ |
| 390 | sys/timers.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 391 | time.h \ |
| 392 | tmpdir.h \ |
| 393 | ttyent.h \ |
Tim Rice | aa8954f | 2007-05-09 15:57:43 -0700 | [diff] [blame] | 394 | ucred.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 395 | unistd.h \ |
| 396 | usersec.h \ |
| 397 | util.h \ |
| 398 | utime.h \ |
| 399 | utmp.h \ |
| 400 | utmpx.h \ |
| 401 | vis.h \ |
Darren Tucker | f3f2cc8 | 2016-07-11 17:23:38 +1000 | [diff] [blame] | 402 | wchar.h \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 403 | ]) |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 404 | |
| 405 | # lastlog.h requires sys/time.h to be included first on Solaris |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 406 | AC_CHECK_HEADERS([lastlog.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 407 | #ifdef HAVE_SYS_TIME_H |
| 408 | # include <sys/time.h> |
| 409 | #endif |
| 410 | ]) |
| 411 | |
| 412 | # 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] | 413 | AC_CHECK_HEADERS([sys/ptms.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 414 | #ifdef HAVE_SYS_STREAM_H |
| 415 | # include <sys/stream.h> |
| 416 | #endif |
| 417 | ]) |
| 418 | |
| 419 | # login_cap.h requires sys/types.h on NetBSD |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 420 | AC_CHECK_HEADERS([login_cap.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 421 | #include <sys/types.h> |
| 422 | ]) |
| 423 | |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 424 | # older BSDs need sys/param.h before sys/mount.h |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 425 | AC_CHECK_HEADERS([sys/mount.h], [], [], [ |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 426 | #include <sys/param.h> |
| 427 | ]) |
| 428 | |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 429 | # Android requires sys/socket.h to be included before sys/un.h |
| 430 | AC_CHECK_HEADERS([sys/un.h], [], [], [ |
Darren Tucker | 0b43ffe | 2013-06-03 09:30:44 +1000 | [diff] [blame] | 431 | #include <sys/types.h> |
Darren Tucker | 16cac19 | 2013-06-04 12:55:24 +1000 | [diff] [blame] | 432 | #include <sys/socket.h> |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 433 | ]) |
| 434 | |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 435 | # Messages for features tested for in target-specific section |
| 436 | SIA_MSG="no" |
| 437 | SPC_MSG="no" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 438 | SP_MSG="no" |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 439 | SPP_MSG="no" |
| 440 | |
| 441 | # Support for Solaris/Illumos privileges (this test is used by both |
| 442 | # the --with-solaris-privs option and --with-sandbox=solaris). |
| 443 | SOLARIS_PRIVS="no" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 444 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 445 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 446 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 447 | *-*-aix*) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 448 | # Some versions of VAC won't allow macro redefinitions at |
| 449 | # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that |
| 450 | # particularly with older versions of vac or xlc. |
| 451 | # It also throws errors about null macro argments, but these are |
| 452 | # not fatal. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 453 | AC_MSG_CHECKING([if compiler allows macro redefinitions]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 454 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 455 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 456 | #define testmacro foo |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 457 | #define testmacro bar]], |
| 458 | [[ exit(0); ]])], |
| 459 | [ AC_MSG_RESULT([yes]) ], |
| 460 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 461 | CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`" |
| 462 | LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`" |
| 463 | CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 464 | CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 465 | ] |
| 466 | ) |
| 467 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 468 | AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 469 | if (test -z "$blibpath"); then |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 470 | blibpath="/usr/lib:/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 471 | fi |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 472 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | bdc1212 | 2006-07-06 11:56:25 +1000 | [diff] [blame] | 473 | if test "$GCC" = "yes"; then |
| 474 | flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:" |
| 475 | else |
| 476 | flags="-blibpath: -Wl,-blibpath: -Wl,-rpath," |
| 477 | fi |
| 478 | for tryflags in $flags ;do |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 479 | if (test -z "$blibflags"); then |
| 480 | LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 481 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
| 482 | [blibflags=$tryflags], []) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 483 | fi |
| 484 | done |
| 485 | if (test -z "$blibflags"); then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 486 | AC_MSG_RESULT([not found]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 487 | AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log]) |
| 488 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 489 | AC_MSG_RESULT([$blibflags]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 490 | fi |
| 491 | LDFLAGS="$saved_LDFLAGS" |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 492 | dnl Check for authenticate. Might be in libs.a on older AIXes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 493 | AC_CHECK_FUNC([authenticate], [AC_DEFINE([WITH_AIXAUTHENTICATE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 494 | [Define if you want to enable AIX4's authenticate function])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 495 | [AC_CHECK_LIB([s], [authenticate], |
| 496 | [ AC_DEFINE([WITH_AIXAUTHENTICATE]) |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 497 | LIBS="$LIBS -ls" |
| 498 | ]) |
| 499 | ]) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 500 | dnl Check for various auth function declarations in headers. |
Darren Tucker | 04cfbe0 | 2005-02-20 23:27:11 +1100 | [diff] [blame] | 501 | AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, |
Darren Tucker | e66519d | 2005-03-21 22:46:34 +1100 | [diff] [blame] | 502 | passwdexpired, setauthdb], , , [#include <usersec.h>]) |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 503 | 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] | 504 | AC_CHECK_DECLS([loginfailed], |
| 505 | [AC_MSG_CHECKING([if loginfailed takes 4 arguments]) |
| 506 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <usersec.h> ]], |
| 507 | [[ (void)loginfailed("user","host","tty",0); ]])], |
| 508 | [AC_MSG_RESULT([yes]) |
| 509 | AC_DEFINE([AIX_LOGINFAILED_4ARG], [1], |
| 510 | [Define if your AIX loginfailed() function |
| 511 | takes 4 arguments (AIX >= 5.2)])], [AC_MSG_RESULT([no]) |
| 512 | ])], |
| 513 | [], |
| 514 | [#include <usersec.h>] |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 515 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 516 | AC_CHECK_FUNCS([getgrset setauthdb]) |
| 517 | AC_CHECK_DECL([F_CLOSEM], |
| 518 | AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]), |
Darren Tucker | 3083bc2 | 2006-08-17 19:35:49 +1000 | [diff] [blame] | 519 | [], |
| 520 | [ #include <limits.h> |
| 521 | #include <fcntl.h> ] |
| 522 | ) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 523 | check_for_aix_broken_getaddrinfo=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 524 | AC_DEFINE([BROKEN_REALPATH], [1], [Define if you have a broken realpath.]) |
| 525 | AC_DEFINE([SETEUID_BREAKS_SETUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 526 | [Define if your platform breaks doing a seteuid before a setuid]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 527 | AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken]) |
| 528 | AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken]) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 529 | dnl AIX handles lastlog as part of its login message |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 530 | AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog]) |
| 531 | AC_DEFINE([LOGIN_NEEDS_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 532 | [Some systems need a utmpx entry for /bin/login to work]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 533 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 534 | [Define to a Set Process Title type if your system is |
| 535 | supported by bsd-setproctitle.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 536 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Darren Tucker | 91d25a0 | 2005-11-26 22:24:09 +1100 | [diff] [blame] | 537 | [AIX 5.2 and 5.3 (and presumably newer) require this]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 538 | 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] | 539 | 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] | 540 | ;; |
Darren Tucker | 898ac93 | 2013-06-03 02:03:25 +1000 | [diff] [blame] | 541 | *-*-android*) |
| 542 | AC_DEFINE([DISABLE_UTMP], [1], [Define if you don't want to use utmp]) |
| 543 | AC_DEFINE([DISABLE_WTMP], [1], [Define if you don't want to use wtmp]) |
| 544 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 545 | *-*-cygwin*) |
Damien Miller | c8936ac | 2003-02-11 10:04:03 +1100 | [diff] [blame] | 546 | check_for_libcrypt_later=1 |
Darren Tucker | 573e387 | 2007-03-02 17:50:03 +1100 | [diff] [blame] | 547 | LIBS="$LIBS /usr/lib/textreadmode.o" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 548 | AC_DEFINE([HAVE_CYGWIN], [1], [Define if you are on Cygwin]) |
| 549 | AC_DEFINE([USE_PIPES], [1], [Use PIPES instead of a socketpair()]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 550 | AC_DEFINE([NO_UID_RESTORATION_TEST], [1], |
| 551 | [Define to disable UID restoration test]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 552 | AC_DEFINE([DISABLE_SHADOW], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 553 | [Define if you want to disable shadow passwords]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 554 | AC_DEFINE([NO_X11_UNIX_SOCKETS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 555 | [Define if X11 doesn't support AF_UNIX sockets on that system]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 556 | AC_DEFINE([DISABLE_FD_PASSING], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 557 | [Define if your platform needs to skip post auth |
| 558 | file descriptor passing]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 559 | AC_DEFINE([SSH_IOBUFSZ], [65535], [Windows is sensitive to read buffer size]) |
Darren Tucker | fdce373 | 2014-01-18 21:12:42 +1100 | [diff] [blame] | 560 | AC_DEFINE([FILESYSTEM_NO_BACKSLASH], [1], [File names may not contain backslash characters]) |
| 561 | # Cygwin defines optargs, optargs as declspec(dllimport) for historical |
| 562 | # reasons which cause compile warnings, so we disable those warnings. |
| 563 | OSSH_CHECK_CFLAG_COMPILE([-Wno-attributes]) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 564 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 565 | *-*-dgux*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 566 | AC_DEFINE([IP_TOS_IS_BROKEN], [1], |
Tim Rice | a74000e | 2009-03-18 11:25:02 -0700 | [diff] [blame] | 567 | [Define if your system choked on IP TOS setting]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 568 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 569 | AC_DEFINE([BROKEN_SETREUID]) |
| 570 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 571 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 572 | *-*-darwin*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 573 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 574 | AC_MSG_CHECKING([if we have working getaddrinfo]) |
| 575 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 576 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
| 577 | exit(0); |
| 578 | else |
| 579 | exit(1); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 580 | } |
| 581 | ]])], |
| 582 | [AC_MSG_RESULT([working])], |
| 583 | [AC_MSG_RESULT([buggy]) |
| 584 | AC_DEFINE([BROKEN_GETADDRINFO], [1], |
| 585 | [getaddrinfo is broken (if present)]) |
| 586 | ], |
| 587 | [AC_MSG_RESULT([assume it is working])]) |
| 588 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 589 | AC_DEFINE([BROKEN_SETREUID]) |
| 590 | AC_DEFINE([BROKEN_SETREGID]) |
| 591 | AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect]) |
| 592 | AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 593 | [Define if your resolver libs need this for getrrsetbyname]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 594 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
| 595 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 596 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 597 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 598 | [Prepend the address family to IP tunnel traffic]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 599 | m4_pattern_allow([AU_IPv]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 600 | AC_CHECK_DECL([AU_IPv4], [], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 601 | AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 602 | [#include <bsm/audit.h>] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 603 | AC_DEFINE([LASTLOG_WRITE_PUTUTXLINE], [1], |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 604 | [Define if pututxline updates lastlog too]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 605 | ) |
Damien Miller | c09182f | 2011-06-03 12:11:38 +1000 | [diff] [blame] | 606 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
| 607 | [Define to a Set Process Title type if your system is |
| 608 | supported by bsd-setproctitle.c]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 609 | AC_CHECK_FUNCS([sandbox_init]) |
| 610 | AC_CHECK_HEADERS([sandbox.h]) |
Damien Miller | 39f303b | 2016-02-23 12:56:59 +1100 | [diff] [blame] | 611 | AC_CHECK_LIB([sandbox], [sandbox_apply], [ |
| 612 | SSHDLIBS="$SSHDLIBS -lsandbox" |
| 613 | ]) |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 614 | ;; |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 615 | *-*-dragonfly*) |
| 616 | SSHDLIBS="$SSHDLIBS -lcrypt" |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 617 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 618 | ;; |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 619 | *-*-haiku*) |
Darren Tucker | 5faa52d | 2016-08-02 15:22:40 +1000 | [diff] [blame] | 620 | LIBS="$LIBS -lbsd " |
| 621 | AC_CHECK_LIB([network], [socket]) |
| 622 | AC_DEFINE([HAVE_U_INT64_T]) |
| 623 | MANTYPE=man |
| 624 | ;; |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 625 | *-*-hpux*) |
| 626 | # 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] | 627 | 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] | 628 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 629 | AC_DEFINE([USE_PIPES]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 630 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
| 631 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 632 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 633 | AC_DEFINE([SPT_TYPE], [SPT_PSTAT]) |
Darren Tucker | aa97d13 | 2013-03-12 11:31:05 +1100 | [diff] [blame] | 634 | 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] | 635 | maildir="/var/mail" |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 636 | LIBS="$LIBS -lsec" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 637 | AC_CHECK_LIB([xnet], [t_error], , |
| 638 | [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 639 | |
| 640 | # next, we define all of the options specific to major releases |
| 641 | case "$host" in |
| 642 | *-*-hpux10*) |
| 643 | if test -z "$GCC"; then |
| 644 | CFLAGS="$CFLAGS -Ae" |
| 645 | fi |
| 646 | ;; |
| 647 | *-*-hpux11*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 648 | AC_DEFINE([PAM_SUN_CODEBASE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 649 | [Define if you are using Solaris-derived PAM which |
| 650 | passes pam_messages to the conversation function |
| 651 | with an extra level of indirection]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 652 | AC_DEFINE([DISABLE_UTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 653 | [Define if you don't want to use utmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 654 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 655 | check_for_hpux_broken_getaddrinfo=1 |
| 656 | check_for_conflicting_getspnam=1 |
| 657 | ;; |
| 658 | esac |
| 659 | |
| 660 | # lastly, we define options specific to minor releases |
| 661 | case "$host" in |
| 662 | *-*-hpux10.26) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 663 | AC_DEFINE([HAVE_SECUREWARE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 664 | [Define if you have SecureWare-based |
| 665 | protected password database]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 666 | disable_ptmx_check=yes |
| 667 | LIBS="$LIBS -lsecpw" |
| 668 | ;; |
| 669 | esac |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 670 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 671 | *-*-irix5*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 672 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 673 | AC_DEFINE([BROKEN_INET_NTOA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 674 | [Define if you system's inet_ntoa is busted |
| 675 | (e.g. Irix gcc issue)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 676 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 677 | AC_DEFINE([BROKEN_SETREUID]) |
| 678 | AC_DEFINE([BROKEN_SETREGID]) |
| 679 | AC_DEFINE([WITH_ABBREV_NO_TTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 680 | [Define if you shouldn't strip 'tty' from your |
| 681 | ttyname in [uw]tmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 682 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 683 | ;; |
| 684 | *-*-irix6*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 685 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 686 | AC_DEFINE([WITH_IRIX_ARRAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 687 | [Define if you have/want arrays |
| 688 | (cluster-wide session managment, not C arrays)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 689 | AC_DEFINE([WITH_IRIX_PROJECT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 690 | [Define if you want IRIX project management]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 691 | AC_DEFINE([WITH_IRIX_AUDIT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 692 | [Define if you want IRIX audit trails]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 693 | AC_CHECK_FUNC([jlimit_startjob], [AC_DEFINE([WITH_IRIX_JOBS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 694 | [Define if you want IRIX kernel jobs])]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 695 | AC_DEFINE([BROKEN_INET_NTOA]) |
| 696 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 697 | AC_DEFINE([BROKEN_SETREUID]) |
| 698 | AC_DEFINE([BROKEN_SETREGID]) |
| 699 | AC_DEFINE([BROKEN_UPDWTMPX], [1], [updwtmpx is broken (if present)]) |
| 700 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 701 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 702 | ;; |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 703 | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) |
| 704 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 705 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 706 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"]) |
| 707 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 708 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 709 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 710 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 711 | *-*-linux*) |
| 712 | no_dev_ptmx=1 |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 713 | use_pie=auto |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 714 | check_for_libcrypt_later=1 |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 715 | check_for_openpty_ctty_bug=1 |
Darren Tucker | c61d5ec | 2017-02-03 14:10:34 +1100 | [diff] [blame] | 716 | dnl Target SUSv3/POSIX.1-2001 plus BSD specifics. |
| 717 | dnl _DEFAULT_SOURCE is the new name for _BSD_SOURCE |
| 718 | CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 719 | AC_DEFINE([PAM_TTY_KLUDGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 720 | [Work around problematic Linux PAM modules handling of PAM_TTY]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 721 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 722 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 723 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 724 | AC_DEFINE([LINK_OPNOTSUPP_ERRNO], [EPERM], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 725 | [Define to whatever link() returns for "not supported" |
| 726 | if it doesn't return EOPNOTSUPP.]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 727 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 728 | AC_DEFINE([USE_BTMP]) |
| 729 | AC_DEFINE([LINUX_OOM_ADJUST], [1], [Adjust Linux out-of-memory killer]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 730 | inet6_default_4in6=yes |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 731 | case `uname -r` in |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 732 | 1.*|2.0.*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 733 | AC_DEFINE([BROKEN_CMSG_TYPE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 734 | [Define if cmsg_type is not passed correctly]) |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 735 | ;; |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 736 | esac |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 737 | # tun(4) forwarding compat code |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 738 | AC_CHECK_HEADERS([linux/if_tun.h]) |
Damien Miller | bd4e410 | 2006-01-01 21:03:30 +1100 | [diff] [blame] | 739 | if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 740 | AC_DEFINE([SSH_TUN_LINUX], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 741 | [Open tunnel devices the Linux tun/tap way]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 742 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 743 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 744 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 745 | [Prepend the address family to IP tunnel traffic]) |
| 746 | fi |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 747 | AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h], [], |
| 748 | [], [#include <linux/types.h>]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 749 | AC_MSG_CHECKING([for seccomp architecture]) |
| 750 | seccomp_audit_arch= |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 751 | case "$host" in |
| 752 | x86_64-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 753 | seccomp_audit_arch=AUDIT_ARCH_X86_64 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 754 | ;; |
| 755 | i*86-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 756 | seccomp_audit_arch=AUDIT_ARCH_I386 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 757 | ;; |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 758 | arm*-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 759 | seccomp_audit_arch=AUDIT_ARCH_ARM |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 760 | ;; |
| 761 | aarch64*-*) |
| 762 | seccomp_audit_arch=AUDIT_ARCH_AARCH64 |
Damien Miller | 5c15e22 | 2015-06-18 15:07:56 +1000 | [diff] [blame] | 763 | ;; |
Damien Miller | b9c5061 | 2016-07-08 13:59:13 +1000 | [diff] [blame] | 764 | s390x-*) |
| 765 | seccomp_audit_arch=AUDIT_ARCH_S390X |
| 766 | ;; |
| 767 | s390-*) |
| 768 | seccomp_audit_arch=AUDIT_ARCH_S390 |
| 769 | ;; |
| 770 | powerpc64-*) |
| 771 | seccomp_audit_arch=AUDIT_ARCH_PPC64 |
| 772 | ;; |
| 773 | powerpc64le-*) |
| 774 | seccomp_audit_arch=AUDIT_ARCH_PPC64LE |
| 775 | ;; |
| 776 | mips-*) |
| 777 | seccomp_audit_arch=AUDIT_ARCH_MIPS |
| 778 | ;; |
| 779 | mipsel-*) |
| 780 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL |
| 781 | ;; |
| 782 | mips64-*) |
| 783 | seccomp_audit_arch=AUDIT_ARCH_MIPS64 |
| 784 | ;; |
| 785 | mips64el-*) |
| 786 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL64 |
| 787 | ;; |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 788 | esac |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 789 | if test "x$seccomp_audit_arch" != "x" ; then |
| 790 | AC_MSG_RESULT(["$seccomp_audit_arch"]) |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 791 | AC_DEFINE_UNQUOTED([SECCOMP_AUDIT_ARCH], [$seccomp_audit_arch], |
| 792 | [Specify the system call convention in use]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 793 | else |
| 794 | AC_MSG_RESULT([architecture not supported]) |
| 795 | fi |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 796 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 797 | mips-sony-bsd|mips-sony-newsos4) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 798 | AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to acquire controlling tty]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 799 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 800 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 801 | *-*-netbsd*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 802 | check_for_libcrypt_before=1 |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 803 | if test "x$withval" != "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 804 | need_dash_r=1 |
| 805 | fi |
Damien Miller | 99522ba | 2016-07-28 08:54:27 +1000 | [diff] [blame] | 806 | CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 807 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 808 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 809 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 810 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 811 | [Prepend the address family to IP tunnel traffic]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 812 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | f5bbd3b | 2014-01-30 11:26:46 +1100 | [diff] [blame] | 813 | AC_DEFINE([BROKEN_READ_COMPARISON], [1], |
| 814 | [NetBSD read function is sometimes redirected, breaking atomicio comparisons against it]) |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 815 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 816 | *-*-freebsd*) |
| 817 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 818 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["*LOCKED*"], [Account locked with pw(1)]) |
| 819 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 820 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 821 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 822 | 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] | 823 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | 2035b22 | 2014-01-26 09:39:53 +1100 | [diff] [blame] | 824 | # Preauth crypto occasionally uses file descriptors for crypto offload |
| 825 | # and will crash if they cannot be opened. |
Damien Miller | 5b447c0 | 2014-01-26 09:46:53 +1100 | [diff] [blame] | 826 | AC_DEFINE([SANDBOX_SKIP_RLIMIT_NOFILE], [1], |
Tim Rice | 03ae081 | 2014-02-21 09:09:34 -0800 | [diff] [blame] | 827 | [define if setrlimit RLIMIT_NOFILE breaks things]) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 828 | ;; |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 829 | *-*-bsdi*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 830 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 831 | AC_DEFINE([BROKEN_SETREUID]) |
| 832 | AC_DEFINE([BROKEN_SETREGID]) |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 833 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 834 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 835 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 836 | conf_utmp_location=/etc/utmp |
| 837 | conf_wtmp_location=/usr/adm/wtmp |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 838 | maildir=/usr/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 839 | AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) |
| 840 | AC_DEFINE([BROKEN_REALPATH]) |
| 841 | AC_DEFINE([USE_PIPES]) |
| 842 | AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 843 | ;; |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 844 | *-*-openbsd*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 845 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 846 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) |
| 847 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) |
| 848 | AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) |
| 849 | AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1], |
Damien Miller | bb59814 | 2006-08-19 08:38:23 +1000 | [diff] [blame] | 850 | [syslog_r function is safe to use in in a signal handler]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 851 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 852 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 853 | *-*-solaris*) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 854 | if test "x$withval" != "xno" ; then |
Tim Rice | ad4a188 | 2004-02-29 15:53:37 -0800 | [diff] [blame] | 855 | need_dash_r=1 |
| 856 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 857 | AC_DEFINE([PAM_SUN_CODEBASE]) |
| 858 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 859 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 860 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 861 | [Define if pam_chauthtok wants real uid set |
| 862 | to the unpriv'ed user]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 863 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 864 | # Pushing STREAMS modules will cause sshd to acquire a controlling tty. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 865 | AC_DEFINE([SSHD_ACQUIRES_CTTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 866 | [Define if sshd somehow reacquires a controlling TTY |
| 867 | after setsid()]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 868 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd |
Darren Tucker | 0249f93 | 2006-06-24 12:10:07 +1000 | [diff] [blame] | 869 | in case the name is longer than 8 chars]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 870 | AC_DEFINE([BROKEN_TCGETATTR_ICANON], [1], [tcgetattr with ICANON may hang]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 871 | external_path_file=/etc/default/login |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 872 | # hardwire lastlog location (can't detect it on some versions) |
| 873 | conf_lastlog_location="/var/adm/lastlog" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 874 | AC_MSG_CHECKING([for obsolete utmp and wtmp in solaris2.x]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 875 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 876 | if test "$sol2ver" -ge 8; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 877 | AC_MSG_RESULT([yes]) |
| 878 | AC_DEFINE([DISABLE_UTMP]) |
| 879 | AC_DEFINE([DISABLE_WTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 880 | [Define if you don't want to use wtmp]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 881 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 882 | AC_MSG_RESULT([no]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 883 | fi |
Darren Tucker | a86ec4d | 2016-06-14 10:48:27 +1000 | [diff] [blame] | 884 | AC_CHECK_FUNCS([setpflags]) |
Darren Tucker | 907091a | 2016-02-19 09:05:39 +1100 | [diff] [blame] | 885 | AC_CHECK_FUNCS([setppriv]) |
| 886 | AC_CHECK_FUNCS([priv_basicset]) |
| 887 | AC_CHECK_HEADERS([priv.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 888 | AC_ARG_WITH([solaris-contracts], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 889 | [ --with-solaris-contracts Enable Solaris process contracts (experimental)], |
| 890 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 891 | AC_CHECK_LIB([contract], [ct_tmpl_activate], |
| 892 | [ AC_DEFINE([USE_SOLARIS_PROCESS_CONTRACTS], [1], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 893 | [Define if you have Solaris process contracts]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 894 | LIBS="$LIBS -lcontract" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 895 | SPC_MSG="yes" ], ) |
| 896 | ], |
| 897 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 898 | AC_ARG_WITH([solaris-projects], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 899 | [ --with-solaris-projects Enable Solaris projects (experimental)], |
| 900 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 901 | AC_CHECK_LIB([project], [setproject], |
| 902 | [ AC_DEFINE([USE_SOLARIS_PROJECTS], [1], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 903 | [Define if you have Solaris projects]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 904 | LIBS="$LIBS -lproject" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 905 | SP_MSG="yes" ], ) |
| 906 | ], |
| 907 | ) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 908 | AC_ARG_WITH([solaris-privs], |
| 909 | [ --with-solaris-privs Enable Solaris/Illumos privileges (experimental)], |
| 910 | [ |
| 911 | AC_MSG_CHECKING([for Solaris/Illumos privilege support]) |
Darren Tucker | 907091a | 2016-02-19 09:05:39 +1100 | [diff] [blame] | 912 | if test "x$ac_cv_func_setppriv" = "xyes" -a \ |
| 913 | "x$ac_cv_header_priv_h" = "xyes" ; then |
| 914 | SOLARIS_PRIVS=yes |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 915 | AC_MSG_RESULT([found]) |
| 916 | AC_DEFINE([NO_UID_RESTORATION_TEST], [1], |
| 917 | [Define to disable UID restoration test]) |
| 918 | AC_DEFINE([USE_SOLARIS_PRIVS], [1], |
| 919 | [Define if you have Solaris privileges]) |
| 920 | SPP_MSG="yes" |
| 921 | else |
| 922 | AC_MSG_RESULT([not found]) |
| 923 | AC_MSG_ERROR([*** must have support for Solaris privileges to use --with-solaris-privs]) |
| 924 | fi |
| 925 | ], |
| 926 | ) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 927 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 928 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 929 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 930 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 931 | AC_CHECK_FUNCS([getpwanam]) |
| 932 | AC_DEFINE([PAM_SUN_CODEBASE]) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 933 | conf_utmp_location=/etc/utmp |
| 934 | conf_wtmp_location=/var/adm/wtmp |
| 935 | conf_lastlog_location=/var/adm/lastlog |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 936 | AC_DEFINE([USE_PIPES]) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 937 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 938 | *-ncr-sysv*) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 939 | LIBS="$LIBS -lc89" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 940 | AC_DEFINE([USE_PIPES]) |
| 941 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 942 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 943 | AC_DEFINE([BROKEN_SETREUID]) |
| 944 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 945 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 946 | *-sni-sysv*) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 947 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 948 | AC_CHECK_LIB([dl], [dlsym], ,) |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 949 | # -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] | 950 | AC_CHECK_LIB([resolv], [res_query], [ LIBS="$LIBS -lresolv" ]) |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 951 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 952 | AC_DEFINE([USE_PIPES]) |
| 953 | AC_DEFINE([IP_TOS_IS_BROKEN]) |
| 954 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 955 | AC_DEFINE([BROKEN_SETREUID]) |
| 956 | AC_DEFINE([BROKEN_SETREGID]) |
| 957 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 958 | external_path_file=/etc/default/login |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 959 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 960 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 961 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 962 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 963 | # 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] | 964 | *-*-sysv4.2*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 965 | AC_DEFINE([USE_PIPES]) |
| 966 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 967 | AC_DEFINE([BROKEN_SETREUID]) |
| 968 | AC_DEFINE([BROKEN_SETREGID]) |
| 969 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd]) |
| 970 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 971 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 972 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 973 | # UnixWare 7.x, OpenUNIX 8 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 974 | *-*-sysv5*) |
Tim Rice | 641ebf1 | 2010-01-17 17:05:39 -0800 | [diff] [blame] | 975 | CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 976 | AC_DEFINE([UNIXWARE_LONG_PASSWORDS], [1], [Support passwords > 8 chars]) |
| 977 | AC_DEFINE([USE_PIPES]) |
| 978 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 979 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 980 | AC_DEFINE([BROKEN_SETREUID]) |
| 981 | AC_DEFINE([BROKEN_SETREGID]) |
| 982 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 983 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 984 | case "$host" in |
| 985 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 986 | maildir=/var/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 987 | AC_DEFINE([BROKEN_LIBIAF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 988 | [ia_uinfo routines not supported by OS yet]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 989 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 990 | AC_CHECK_LIB([prot], [getluid], [ LIBS="$LIBS -lprot" |
| 991 | AC_CHECK_FUNCS([getluid setluid], , , [-lprot]) |
| 992 | AC_DEFINE([HAVE_SECUREWARE]) |
| 993 | AC_DEFINE([DISABLE_SHADOW]) |
| 994 | ], , ) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 995 | ;; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 996 | *) AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 2676791 | 2009-01-07 20:50:08 -0800 | [diff] [blame] | 997 | check_for_libcrypt_later=1 |
Tim Rice | 46259d8 | 2005-11-28 18:40:34 -0800 | [diff] [blame] | 998 | ;; |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 999 | esac |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1000 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1001 | *-*-sysv*) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1002 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1003 | # SCO UNIX and OEM versions of SCO UNIX |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1004 | *-*-sco3.2v4*) |
Tim Rice | c390c8d | 2005-03-07 01:21:37 -0800 | [diff] [blame] | 1005 | AC_MSG_ERROR("This Platform is no longer supported.") |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1006 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1007 | # SCO OpenServer 5.x |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1008 | *-*-sco3.2v5*) |
Tim Rice | 89fe3f3 | 2003-01-19 20:20:24 -0800 | [diff] [blame] | 1009 | if test -z "$GCC"; then |
| 1010 | CFLAGS="$CFLAGS -belf" |
| 1011 | fi |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 1012 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1013 | no_dev_ptmx=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1014 | AC_DEFINE([USE_PIPES]) |
| 1015 | AC_DEFINE([HAVE_SECUREWARE]) |
| 1016 | AC_DEFINE([DISABLE_SHADOW]) |
| 1017 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 1018 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1019 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1020 | AC_DEFINE([BROKEN_SETREUID]) |
| 1021 | AC_DEFINE([BROKEN_SETREGID]) |
| 1022 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1023 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 1024 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
| 1025 | AC_CHECK_FUNCS([getluid setluid]) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 1026 | MANTYPE=man |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1027 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 1028 | SKIP_DISABLE_LASTLOG_DEFINE=yes |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1029 | ;; |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1030 | *-*-unicosmk*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1031 | AC_DEFINE([NO_SSH_LASTLOG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1032 | [Define if you don't want to use lastlog in session.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1033 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1034 | AC_DEFINE([BROKEN_SETREUID]) |
| 1035 | AC_DEFINE([BROKEN_SETREGID]) |
| 1036 | AC_DEFINE([USE_PIPES]) |
| 1037 | AC_DEFINE([DISABLE_FD_PASSING]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1038 | LDFLAGS="$LDFLAGS" |
| 1039 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 1040 | MANTYPE=cat |
Ben Lindstrom | 762104e | 2002-07-23 00:00:05 +0000 | [diff] [blame] | 1041 | ;; |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1042 | *-*-unicosmp*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1043 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1044 | AC_DEFINE([BROKEN_SETREUID]) |
| 1045 | AC_DEFINE([BROKEN_SETREGID]) |
| 1046 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1047 | AC_DEFINE([USE_PIPES]) |
| 1048 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1049 | LDFLAGS="$LDFLAGS" |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 1050 | LIBS="$LIBS -lgen -lacid -ldb" |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1051 | MANTYPE=cat |
| 1052 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 1053 | *-*-unicos*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1054 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1055 | AC_DEFINE([BROKEN_SETREUID]) |
| 1056 | AC_DEFINE([BROKEN_SETREGID]) |
| 1057 | AC_DEFINE([USE_PIPES]) |
| 1058 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 1059 | AC_DEFINE([NO_SSH_LASTLOG]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1060 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" |
| 1061 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 1062 | MANTYPE=cat |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 1063 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1064 | *-dec-osf*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1065 | AC_MSG_CHECKING([for Digital Unix SIA]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1066 | no_osfsia="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1067 | AC_ARG_WITH([osfsia], |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1068 | [ --with-osfsia Enable Digital Unix SIA], |
| 1069 | [ |
| 1070 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1071 | AC_MSG_RESULT([disabled]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1072 | no_osfsia=1 |
| 1073 | fi |
| 1074 | ], |
| 1075 | ) |
| 1076 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1077 | if test -f /etc/sia/matrix.conf; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1078 | AC_MSG_RESULT([yes]) |
| 1079 | AC_DEFINE([HAVE_OSF_SIA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1080 | [Define if you have Digital Unix Security |
| 1081 | Integration Architecture]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1082 | AC_DEFINE([DISABLE_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1083 | [Define if you don't want to use your |
| 1084 | system's login() call]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1085 | AC_DEFINE([DISABLE_FD_PASSING]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1086 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 1087 | SIA_MSG="yes" |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1088 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1089 | AC_MSG_RESULT([no]) |
| 1090 | AC_DEFINE([LOCKED_PASSWD_SUBSTR], ["Nologin"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1091 | [String used in /etc/passwd to denote locked account]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1092 | fi |
| 1093 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1094 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1095 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1096 | AC_DEFINE([BROKEN_SETREUID]) |
| 1097 | AC_DEFINE([BROKEN_SETREGID]) |
| 1098 | AC_DEFINE([BROKEN_READV_COMPARISON], [1], [Can't do comparisons on readv]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1099 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1100 | |
Tim Rice | 70335a6 | 2006-02-04 17:42:58 -0800 | [diff] [blame] | 1101 | *-*-nto-qnx*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1102 | AC_DEFINE([USE_PIPES]) |
| 1103 | AC_DEFINE([NO_X11_UNIX_SOCKETS]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1104 | AC_DEFINE([DISABLE_LASTLOG]) |
| 1105 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 1106 | AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken]) |
Tim Rice | 2f99346 | 2006-02-11 18:37:48 -0800 | [diff] [blame] | 1107 | enable_etc_default_login=no # has incompatible /etc/default/login |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1108 | case "$host" in |
| 1109 | *-*-nto-qnx6*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1110 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1111 | ;; |
| 1112 | esac |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1113 | ;; |
Darren Tucker | 2be1cbb | 2005-05-27 21:13:40 +1000 | [diff] [blame] | 1114 | |
| 1115 | *-*-ultrix*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1116 | AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1117 | AC_DEFINE([NEED_SETPGRP]) |
| 1118 | 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] | 1119 | ;; |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 1120 | |
| 1121 | *-*-lynxos) |
Darren Tucker | 5faa52d | 2016-08-02 15:22:40 +1000 | [diff] [blame] | 1122 | CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" |
| 1123 | AC_DEFINE([BROKEN_SETVBUF], [1], |
| 1124 | [LynxOS has broken setvbuf() implementation]) |
| 1125 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1126 | esac |
| 1127 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1128 | AC_MSG_CHECKING([compiler and flags for sanity]) |
| 1129 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])], |
| 1130 | [ AC_MSG_RESULT([yes]) ], |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1131 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1132 | AC_MSG_RESULT([no]) |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1133 | AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1134 | ], |
| 1135 | [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1136 | ) |
| 1137 | |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1138 | dnl Checks for header files. |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1139 | # Checks for libraries. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1140 | AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])]) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1141 | |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1142 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1143 | AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [ |
| 1144 | AC_CHECK_LIB([gen], [dirname], [ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1145 | AC_CACHE_CHECK([for broken dirname], |
| 1146 | ac_cv_have_broken_dirname, [ |
| 1147 | save_LIBS="$LIBS" |
| 1148 | LIBS="$LIBS -lgen" |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1149 | AC_RUN_IFELSE( |
| 1150 | [AC_LANG_SOURCE([[ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1151 | #include <libgen.h> |
| 1152 | #include <string.h> |
| 1153 | |
| 1154 | int main(int argc, char **argv) { |
| 1155 | char *s, buf[32]; |
| 1156 | |
| 1157 | strncpy(buf,"/etc", 32); |
| 1158 | s = dirname(buf); |
| 1159 | if (!s || strncmp(s, "/", 32) != 0) { |
| 1160 | exit(1); |
| 1161 | } else { |
| 1162 | exit(0); |
| 1163 | } |
| 1164 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1165 | ]])], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1166 | [ ac_cv_have_broken_dirname="no" ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1167 | [ ac_cv_have_broken_dirname="yes" ], |
| 1168 | [ ac_cv_have_broken_dirname="no" ], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1169 | ) |
| 1170 | LIBS="$save_LIBS" |
| 1171 | ]) |
| 1172 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
| 1173 | LIBS="$LIBS -lgen" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1174 | AC_DEFINE([HAVE_DIRNAME]) |
| 1175 | AC_CHECK_HEADERS([libgen.h]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1176 | fi |
| 1177 | ]) |
| 1178 | ]) |
| 1179 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1180 | AC_CHECK_FUNC([getspnam], , |
| 1181 | [AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])]) |
| 1182 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], |
| 1183 | [Define if you have the basename function.])]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1184 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1185 | dnl zlib is required |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1186 | AC_ARG_WITH([zlib], |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1187 | [ --with-zlib=PATH Use zlib in PATH], |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1188 | [ if test "x$withval" = "xno" ; then |
| 1189 | AC_MSG_ERROR([*** zlib is required ***]) |
| 1190 | elif test "x$withval" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1191 | if test -d "$withval/lib"; then |
| 1192 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1193 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1194 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1195 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1196 | fi |
| 1197 | else |
| 1198 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1199 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1200 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1201 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1202 | fi |
| 1203 | fi |
| 1204 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1205 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1206 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1207 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1208 | fi |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1209 | fi ] |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1210 | ) |
| 1211 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1212 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) |
| 1213 | AC_CHECK_LIB([z], [deflate], , |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1214 | [ |
| 1215 | saved_CPPFLAGS="$CPPFLAGS" |
| 1216 | saved_LDFLAGS="$LDFLAGS" |
| 1217 | save_LIBS="$LIBS" |
| 1218 | dnl Check default zlib install dir |
| 1219 | if test -n "${need_dash_r}"; then |
| 1220 | LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}" |
| 1221 | else |
| 1222 | LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" |
| 1223 | fi |
| 1224 | CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" |
| 1225 | LIBS="$LIBS -lz" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1226 | AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])], |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1227 | [ |
| 1228 | AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) |
| 1229 | ] |
| 1230 | ) |
| 1231 | ] |
| 1232 | ) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1233 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1234 | AC_ARG_WITH([zlib-version-check], |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1235 | [ --without-zlib-version-check Disable zlib version check], |
| 1236 | [ if test "x$withval" = "xno" ; then |
| 1237 | zlib_check_nonfatal=1 |
| 1238 | fi |
| 1239 | ] |
| 1240 | ) |
| 1241 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1242 | AC_MSG_CHECKING([for possibly buggy zlib]) |
| 1243 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1244 | #include <stdio.h> |
Darren Tucker | c8a0f27 | 2013-03-22 12:49:14 +1100 | [diff] [blame] | 1245 | #include <stdlib.h> |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1246 | #include <zlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1247 | ]], |
| 1248 | [[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1249 | int a=0, b=0, c=0, d=0, n, v; |
| 1250 | n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); |
| 1251 | if (n != 3 && n != 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1252 | exit(1); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1253 | v = a*1000000 + b*10000 + c*100 + d; |
| 1254 | fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); |
| 1255 | |
| 1256 | /* 1.1.4 is OK */ |
| 1257 | if (a == 1 && b == 1 && c >= 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1258 | exit(0); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1259 | |
Darren Tucker | 41097ed | 2005-07-25 15:24:21 +1000 | [diff] [blame] | 1260 | /* 1.2.3 and up are OK */ |
| 1261 | if (v >= 1020300) |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1262 | exit(0); |
| 1263 | |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1264 | exit(2); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1265 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1266 | AC_MSG_RESULT([no]), |
| 1267 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1268 | if test -z "$zlib_check_nonfatal" ; then |
| 1269 | AC_MSG_ERROR([*** zlib too old - check config.log *** |
| 1270 | Your reported zlib version has known security problems. It's possible your |
| 1271 | vendor has fixed these problems without changing the version number. If you |
| 1272 | are sure this is the case, you can disable the check by running |
| 1273 | "./configure --without-zlib-version-check". |
Darren Tucker | ac1910f | 2005-07-26 12:00:42 +1000 | [diff] [blame] | 1274 | 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] | 1275 | See http://www.gzip.org/zlib/ for details.]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1276 | else |
| 1277 | AC_MSG_WARN([zlib version may have security problems]) |
| 1278 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1279 | ], |
| 1280 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1281 | ) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1282 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1283 | dnl UnixWare 2.x |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1284 | AC_CHECK_FUNC([strcasecmp], |
| 1285 | [], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1286 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1287 | AC_CHECK_FUNCS([utimes], |
| 1288 | [], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES]) |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 1289 | LIBS="$LIBS -lc89"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1290 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1291 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1292 | dnl Checks for libutil functions |
Damien Miller | b87f6b7 | 2013-02-23 09:12:23 +1100 | [diff] [blame] | 1293 | AC_CHECK_HEADERS([bsd/libutil.h libutil.h]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1294 | AC_SEARCH_LIBS([fmt_scaled], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1295 | AC_SEARCH_LIBS([scan_scaled], [util bsd]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1296 | AC_SEARCH_LIBS([login], [util bsd]) |
| 1297 | AC_SEARCH_LIBS([logout], [util bsd]) |
| 1298 | AC_SEARCH_LIBS([logwtmp], [util bsd]) |
| 1299 | AC_SEARCH_LIBS([openpty], [util bsd]) |
| 1300 | AC_SEARCH_LIBS([updwtmp], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1301 | AC_CHECK_FUNCS([fmt_scaled scan_scaled login logout openpty updwtmp logwtmp]) |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1302 | |
Darren Tucker | 2fee909 | 2016-02-17 09:48:15 +1100 | [diff] [blame] | 1303 | # On some platforms, inet_ntop and gethostbyname may be found in libresolv |
| 1304 | # or libnsl. |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1305 | AC_SEARCH_LIBS([inet_ntop], [resolv nsl]) |
Darren Tucker | 2fee909 | 2016-02-17 09:48:15 +1100 | [diff] [blame] | 1306 | AC_SEARCH_LIBS([gethostbyname], [resolv nsl]) |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1307 | |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 1308 | AC_FUNC_STRFTIME |
| 1309 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1310 | # Check for ALTDIRFUNC glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1311 | AC_MSG_CHECKING([for GLOB_ALTDIRFUNC support]) |
| 1312 | AC_EGREP_CPP([FOUNDIT], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1313 | [ |
| 1314 | #include <glob.h> |
| 1315 | #ifdef GLOB_ALTDIRFUNC |
| 1316 | FOUNDIT |
| 1317 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1318 | ], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1319 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1320 | AC_DEFINE([GLOB_HAS_ALTDIRFUNC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1321 | [Define if your system glob() function has |
| 1322 | the GLOB_ALTDIRFUNC extension]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1323 | AC_MSG_RESULT([yes]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1324 | ], |
| 1325 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1326 | AC_MSG_RESULT([no]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1327 | ] |
| 1328 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1329 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1330 | # Check for g.gl_matchc glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1331 | AC_MSG_CHECKING([for gl_matchc field in glob_t]) |
| 1332 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], |
| 1333 | [[ glob_t g; g.gl_matchc = 1; ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1334 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1335 | AC_DEFINE([GLOB_HAS_GL_MATCHC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1336 | [Define if your system glob() function has |
| 1337 | gl_matchc options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1338 | AC_MSG_RESULT([yes]) |
| 1339 | ], [ |
| 1340 | AC_MSG_RESULT([no]) |
| 1341 | ]) |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1342 | |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1343 | # Check for g.gl_statv glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1344 | AC_MSG_CHECKING([for gl_statv and GLOB_KEEPSTAT extensions for glob]) |
| 1345 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], [[ |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1346 | #ifndef GLOB_KEEPSTAT |
| 1347 | #error "glob does not support GLOB_KEEPSTAT extension" |
| 1348 | #endif |
| 1349 | glob_t g; |
| 1350 | g.gl_statv = NULL; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1351 | ]])], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1352 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1353 | AC_DEFINE([GLOB_HAS_GL_STATV], [1], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1354 | [Define if your system glob() function has |
| 1355 | gl_statv options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1356 | AC_MSG_RESULT([yes]) |
| 1357 | ], [ |
| 1358 | AC_MSG_RESULT([no]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1359 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1360 | ]) |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1361 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1362 | AC_CHECK_DECLS([GLOB_NOMATCH], , , [#include <glob.h>]) |
Darren Tucker | 096faec | 2006-09-01 20:29:10 +1000 | [diff] [blame] | 1363 | |
Darren Tucker | 7df91b0 | 2016-07-14 12:25:24 +1000 | [diff] [blame] | 1364 | AC_CHECK_DECL([VIS_ALL], , |
| 1365 | AC_DEFINE(BROKEN_STRNVIS, 1, [missing VIS_ALL]), [#include <vis.h>]) |
| 1366 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1367 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1368 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1369 | [AC_LANG_PROGRAM([[ |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1370 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1371 | #include <dirent.h>]], |
| 1372 | [[ |
| 1373 | struct dirent d; |
| 1374 | exit(sizeof(d.d_name)<=sizeof(char)); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1375 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1376 | [AC_MSG_RESULT([yes])], |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1377 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1378 | AC_MSG_RESULT([no]) |
| 1379 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1], |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 1380 | [Define if your struct dirent expects you to |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1381 | allocate extra space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1382 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1383 | [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1384 | AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1385 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1386 | ] |
| 1387 | ) |
| 1388 | |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1389 | AC_MSG_CHECKING([for /proc/pid/fd directory]) |
| 1390 | if test -d "/proc/$$/fd" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1391 | AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd]) |
| 1392 | AC_MSG_RESULT([yes]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1393 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1394 | AC_MSG_RESULT([no]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1395 | fi |
| 1396 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1397 | # Check whether user wants S/Key support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1398 | SKEY_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1399 | AC_ARG_WITH([skey], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1400 | [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1401 | [ |
| 1402 | if test "x$withval" != "xno" ; then |
| 1403 | |
| 1404 | if test "x$withval" != "xyes" ; then |
| 1405 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1406 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1407 | fi |
| 1408 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1409 | AC_DEFINE([SKEY], [1], [Define if you want S/Key support]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1410 | LIBS="-lskey $LIBS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1411 | SKEY_MSG="yes" |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1412 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1413 | AC_MSG_CHECKING([for s/key support]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1414 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1415 | [AC_LANG_PROGRAM([[ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1416 | #include <stdio.h> |
| 1417 | #include <skey.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1418 | ]], [[ |
| 1419 | char *ff = skey_keyinfo(""); ff=""; |
| 1420 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1421 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1422 | [AC_MSG_RESULT([yes])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1423 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1424 | AC_MSG_RESULT([no]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1425 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 1426 | ]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1427 | AC_MSG_CHECKING([if skeychallenge takes 4 arguments]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1428 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1429 | #include <stdio.h> |
| 1430 | #include <skey.h> |
| 1431 | ]], [[ |
| 1432 | (void)skeychallenge(NULL,"name","",0); |
| 1433 | ]])], |
| 1434 | [ |
| 1435 | AC_MSG_RESULT([yes]) |
| 1436 | AC_DEFINE([SKEYCHALLENGE_4ARG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1437 | [Define if your skeychallenge() |
| 1438 | function takes 4 arguments (NetBSD)])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1439 | [ |
| 1440 | AC_MSG_RESULT([no]) |
| 1441 | ]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1442 | fi |
| 1443 | ] |
| 1444 | ) |
| 1445 | |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1446 | # Check whether user wants to use ldns |
| 1447 | LDNS_MSG="no" |
| 1448 | AC_ARG_WITH(ldns, |
| 1449 | [ --with-ldns[[=PATH]] Use ldns for DNSSEC support (optionally in PATH)], |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1450 | [ |
| 1451 | ldns="" |
| 1452 | if test "x$withval" = "xyes" ; then |
| 1453 | AC_PATH_TOOL([LDNSCONFIG], [ldns-config], [no]) |
| 1454 | if test "x$PKGCONFIG" = "xno"; then |
| 1455 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1456 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1457 | LIBS="-lldns $LIBS" |
| 1458 | ldns=yes |
| 1459 | else |
| 1460 | LIBS="$LIBS `$LDNSCONFIG --libs`" |
| 1461 | CPPFLAGS="$CPPFLAGS `$LDNSCONFIG --cflags`" |
Darren Tucker | 7af27bf | 2017-03-24 09:44:56 +1100 | [diff] [blame] | 1462 | ldns=yes |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1463 | fi |
| 1464 | elif test "x$withval" != "xno" ; then |
| 1465 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1466 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1467 | LIBS="-lldns $LIBS" |
| 1468 | ldns=yes |
| 1469 | fi |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1470 | |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1471 | # Verify that it works. |
| 1472 | if test "x$ldns" = "xyes" ; then |
| 1473 | AC_DEFINE(HAVE_LDNS, 1, [Define if you want ldns support]) |
| 1474 | LDNS_MSG="yes" |
| 1475 | AC_MSG_CHECKING([for ldns support]) |
| 1476 | AC_LINK_IFELSE( |
| 1477 | [AC_LANG_SOURCE([[ |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1478 | #include <stdio.h> |
| 1479 | #include <stdlib.h> |
| 1480 | #include <stdint.h> |
| 1481 | #include <ldns/ldns.h> |
| 1482 | 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] | 1483 | ]]) |
| 1484 | ], |
| 1485 | [AC_MSG_RESULT(yes)], |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1486 | [ |
| 1487 | AC_MSG_RESULT(no) |
| 1488 | AC_MSG_ERROR([** Incomplete or missing ldns libraries.]) |
| 1489 | ]) |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1490 | fi |
| 1491 | ]) |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1492 | |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1493 | # Check whether user wants libedit support |
| 1494 | LIBEDIT_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1495 | AC_ARG_WITH([libedit], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1496 | [ --with-libedit[[=PATH]] Enable libedit support for sftp], |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1497 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1498 | if test "x$withval" = "xyes" ; then |
Darren Tucker | 5935389 | 2012-05-19 15:24:37 +1000 | [diff] [blame] | 1499 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1500 | if test "x$PKGCONFIG" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1501 | AC_MSG_CHECKING([if $PKGCONFIG knows about libedit]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1502 | if "$PKGCONFIG" libedit; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1503 | AC_MSG_RESULT([yes]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1504 | use_pkgconfig_for_libedit=yes |
| 1505 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1506 | AC_MSG_RESULT([no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1507 | fi |
| 1508 | fi |
| 1509 | else |
Darren Tucker | c373a56 | 2005-09-22 20:15:08 +1000 | [diff] [blame] | 1510 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1511 | if test -n "${need_dash_r}"; then |
| 1512 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 1513 | else |
| 1514 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 1515 | fi |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1516 | fi |
Damien Miller | 1f78980 | 2010-10-11 22:35:22 +1100 | [diff] [blame] | 1517 | if test "x$use_pkgconfig_for_libedit" = "xyes"; then |
Darren Tucker | 8369c8e | 2013-12-05 11:00:16 +1100 | [diff] [blame] | 1518 | LIBEDIT=`$PKGCONFIG --libs libedit` |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1519 | CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" |
| 1520 | else |
| 1521 | LIBEDIT="-ledit -lcurses" |
| 1522 | fi |
| 1523 | OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1524 | AC_CHECK_LIB([edit], [el_init], |
| 1525 | [ AC_DEFINE([USE_LIBEDIT], [1], [Use libedit for sftp]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1526 | LIBEDIT_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1527 | AC_SUBST([LIBEDIT]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1528 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1529 | [ AC_MSG_ERROR([libedit not found]) ], |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1530 | [ $OTHERLIBS ] |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1531 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1532 | AC_MSG_CHECKING([if libedit version is compatible]) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1533 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1534 | [AC_LANG_PROGRAM([[ #include <histedit.h> ]], |
| 1535 | [[ |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1536 | int i = H_SETSIZE; |
| 1537 | el_init("", NULL, NULL, NULL); |
| 1538 | exit(0); |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1539 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1540 | [ AC_MSG_RESULT([yes]) ], |
| 1541 | [ AC_MSG_RESULT([no]) |
| 1542 | AC_MSG_ERROR([libedit version is not compatible]) ] |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1543 | ) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1544 | fi ] |
| 1545 | ) |
| 1546 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1547 | AUDIT_MODULE=none |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1548 | AC_ARG_WITH([audit], |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1549 | [ --with-audit=module Enable audit support (modules=debug,bsm,linux)], |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1550 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1551 | AC_MSG_CHECKING([for supported audit module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1552 | case "$withval" in |
| 1553 | bsm) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1554 | AC_MSG_RESULT([bsm]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1555 | AUDIT_MODULE=bsm |
| 1556 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1557 | AC_CHECK_HEADERS([bsm/audit.h], [], |
| 1558 | [AC_MSG_ERROR([BSM enabled and bsm/audit.h not found])], |
Darren Tucker | 6d0d6fb | 2006-09-09 01:05:21 +1000 | [diff] [blame] | 1559 | [ |
| 1560 | #ifdef HAVE_TIME_H |
| 1561 | # include <time.h> |
| 1562 | #endif |
| 1563 | ] |
| 1564 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1565 | AC_CHECK_LIB([bsm], [getaudit], [], |
| 1566 | [AC_MSG_ERROR([BSM enabled and required library not found])]) |
| 1567 | AC_CHECK_FUNCS([getaudit], [], |
| 1568 | [AC_MSG_ERROR([BSM enabled and required function not found])]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1569 | # These are optional |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1570 | AC_CHECK_FUNCS([getaudit_addr aug_get_machine]) |
| 1571 | AC_DEFINE([USE_BSM_AUDIT], [1], [Use BSM audit module]) |
Darren Tucker | 1fcec9d | 2013-12-19 11:00:12 +1100 | [diff] [blame] | 1572 | if test "$sol2ver" -ge 11; then |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1573 | SSHDLIBS="$SSHDLIBS -lscf" |
| 1574 | AC_DEFINE([BROKEN_BSM_API], [1], |
| 1575 | [The system has incomplete BSM API]) |
Darren Tucker | 93a2d41 | 2012-02-24 10:40:41 +1100 | [diff] [blame] | 1576 | fi |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1577 | ;; |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1578 | linux) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1579 | AC_MSG_RESULT([linux]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1580 | AUDIT_MODULE=linux |
| 1581 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1582 | AC_CHECK_HEADERS([libaudit.h]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1583 | SSHDLIBS="$SSHDLIBS -laudit" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1584 | AC_DEFINE([USE_LINUX_AUDIT], [1], [Use Linux audit module]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1585 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1586 | debug) |
| 1587 | AUDIT_MODULE=debug |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1588 | AC_MSG_RESULT([debug]) |
| 1589 | AC_DEFINE([SSH_AUDIT_EVENTS], [1], [Use audit debugging module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1590 | ;; |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1591 | no) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1592 | AC_MSG_RESULT([no]) |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1593 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1594 | *) |
| 1595 | AC_MSG_ERROR([Unknown audit module $withval]) |
| 1596 | ;; |
| 1597 | esac ] |
| 1598 | ) |
| 1599 | |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1600 | AC_ARG_WITH([pie], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 1601 | [ --with-pie Build Position Independent Executables if possible], [ |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1602 | if test "x$withval" = "xno"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1603 | use_pie=no |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1604 | fi |
| 1605 | if test "x$withval" = "xyes"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1606 | use_pie=yes |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1607 | fi |
| 1608 | ] |
| 1609 | ) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1610 | if test "x$use_pie" = "x"; then |
| 1611 | use_pie=no |
| 1612 | fi |
| 1613 | if test "x$use_toolchain_hardening" != "x1" && test "x$use_pie" = "xauto"; then |
| 1614 | # Turn off automatic PIE when toolchain hardening is off. |
| 1615 | use_pie=no |
| 1616 | fi |
Damien Miller | c161fc9 | 2014-01-29 21:01:33 +1100 | [diff] [blame] | 1617 | if test "x$use_pie" = "xauto"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1618 | # Automatic PIE requires gcc >= 4.x |
| 1619 | AC_MSG_CHECKING([for gcc >= 4.x]) |
| 1620 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
| 1621 | #if !defined(__GNUC__) || __GNUC__ < 4 |
| 1622 | #error gcc is too old |
| 1623 | #endif |
| 1624 | ]])], |
| 1625 | [ AC_MSG_RESULT([yes]) ], |
| 1626 | [ AC_MSG_RESULT([no]) |
| 1627 | use_pie=no ] |
| 1628 | ) |
| 1629 | fi |
| 1630 | if test "x$use_pie" != "xno"; then |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1631 | SAVED_CFLAGS="$CFLAGS" |
| 1632 | SAVED_LDFLAGS="$LDFLAGS" |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1633 | OSSH_CHECK_CFLAG_COMPILE([-fPIE]) |
| 1634 | OSSH_CHECK_LDFLAG_LINK([-pie]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1635 | # We use both -fPIE and -pie or neither. |
| 1636 | AC_MSG_CHECKING([whether both -fPIE and -pie are supported]) |
| 1637 | if echo "x $CFLAGS" | grep ' -fPIE' >/dev/null 2>&1 && \ |
| 1638 | echo "x $LDFLAGS" | grep ' -pie' >/dev/null 2>&1 ; then |
| 1639 | AC_MSG_RESULT([yes]) |
| 1640 | else |
| 1641 | AC_MSG_RESULT([no]) |
| 1642 | CFLAGS="$SAVED_CFLAGS" |
| 1643 | LDFLAGS="$SAVED_LDFLAGS" |
| 1644 | fi |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1645 | fi |
| 1646 | |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1647 | dnl Checks for library functions. Please keep in alphabetical order |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1648 | AC_CHECK_FUNCS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1649 | Blowfish_initstate \ |
| 1650 | Blowfish_expandstate \ |
| 1651 | Blowfish_expand0state \ |
| 1652 | Blowfish_stream2word \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1653 | asprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1654 | b64_ntop \ |
| 1655 | __b64_ntop \ |
| 1656 | b64_pton \ |
| 1657 | __b64_pton \ |
| 1658 | bcopy \ |
Damien Miller | a913442 | 2013-12-07 11:35:36 +1100 | [diff] [blame] | 1659 | bcrypt_pbkdf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1660 | bindresvport_sa \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1661 | blf_enc \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 1662 | cap_rights_limit \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1663 | clock \ |
| 1664 | closefrom \ |
| 1665 | dirfd \ |
Darren Tucker | efdf534 | 2013-05-30 08:29:08 +1000 | [diff] [blame] | 1666 | endgrent \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 1667 | err \ |
| 1668 | errx \ |
Damien Miller | 1d2c456 | 2014-02-04 11:18:20 +1100 | [diff] [blame] | 1669 | explicit_bzero \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1670 | fchmod \ |
| 1671 | fchown \ |
| 1672 | freeaddrinfo \ |
Darren Tucker | a5cf1e2 | 2014-01-17 18:10:58 +1100 | [diff] [blame] | 1673 | fstatfs \ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 1674 | fstatvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1675 | futimes \ |
| 1676 | getaddrinfo \ |
| 1677 | getcwd \ |
| 1678 | getgrouplist \ |
| 1679 | getnameinfo \ |
| 1680 | getopt \ |
| 1681 | getpeereid \ |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1682 | getpeerucred \ |
Darren Tucker | 3c4a24c | 2013-02-15 11:41:35 +1100 | [diff] [blame] | 1683 | getpgid \ |
| 1684 | getpgrp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1685 | _getpty \ |
| 1686 | getrlimit \ |
| 1687 | getttyent \ |
| 1688 | glob \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1689 | group_from_gid \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1690 | inet_aton \ |
| 1691 | inet_ntoa \ |
| 1692 | inet_ntop \ |
| 1693 | innetgr \ |
Darren Tucker | d38f05d | 2017-03-20 13:38:27 +1100 | [diff] [blame] | 1694 | llabs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1695 | login_getcapbool \ |
| 1696 | md5_crypt \ |
| 1697 | memmove \ |
Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 1698 | memset_s \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1699 | mkdtemp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1700 | ngetaddrinfo \ |
| 1701 | nsleep \ |
| 1702 | ogetaddrinfo \ |
| 1703 | openlog_r \ |
Darren Tucker | 3ddd15e | 2015-11-30 07:23:53 +1100 | [diff] [blame] | 1704 | pledge \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 1705 | poll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1706 | prctl \ |
| 1707 | pstat \ |
| 1708 | readpassphrase \ |
Darren Tucker | 642652d | 2014-12-10 01:32:23 +1100 | [diff] [blame] | 1709 | reallocarray \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1710 | recvmsg \ |
| 1711 | rresvport_af \ |
| 1712 | sendmsg \ |
| 1713 | setdtablesize \ |
| 1714 | setegid \ |
| 1715 | setenv \ |
| 1716 | seteuid \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1717 | setgroupent \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1718 | setgroups \ |
Darren Tucker | 34f702a | 2012-07-04 08:50:09 +1000 | [diff] [blame] | 1719 | setlinebuf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1720 | setlogin \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1721 | setpassent\ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1722 | setpcred \ |
| 1723 | setproctitle \ |
| 1724 | setregid \ |
| 1725 | setreuid \ |
| 1726 | setrlimit \ |
| 1727 | setsid \ |
| 1728 | setvbuf \ |
| 1729 | sigaction \ |
| 1730 | sigvec \ |
| 1731 | snprintf \ |
| 1732 | socketpair \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 1733 | statfs \ |
| 1734 | statvfs \ |
Darren Tucker | afec077 | 2016-12-13 10:23:03 +1100 | [diff] [blame] | 1735 | strcasestr \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1736 | strdup \ |
| 1737 | strerror \ |
| 1738 | strlcat \ |
| 1739 | strlcpy \ |
| 1740 | strmode \ |
Darren Tucker | b54f50e | 2011-09-29 23:17:18 +1000 | [diff] [blame] | 1741 | strnlen \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1742 | strnvis \ |
Darren Tucker | aa74f67 | 2010-08-16 13:15:23 +1000 | [diff] [blame] | 1743 | strptime \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1744 | strtonum \ |
Darren Tucker | 81eb5d5 | 2005-06-01 21:39:33 +1000 | [diff] [blame] | 1745 | strtoll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1746 | strtoul \ |
Darren Tucker | 8e6fb78 | 2013-02-15 12:13:01 +1100 | [diff] [blame] | 1747 | strtoull \ |
Damien Miller | 34a1769 | 2007-06-11 14:15:42 +1000 | [diff] [blame] | 1748 | swap32 \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1749 | sysconf \ |
| 1750 | tcgetpgrp \ |
Damien Miller | aa18063 | 2010-10-07 21:25:27 +1100 | [diff] [blame] | 1751 | timingsafe_bcmp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1752 | truncate \ |
| 1753 | unsetenv \ |
| 1754 | updwtmpx \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1755 | user_from_uid \ |
Damien Miller | f4db77d | 2013-03-15 10:34:25 +1100 | [diff] [blame] | 1756 | usleep \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1757 | vasprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1758 | vsnprintf \ |
| 1759 | waitpid \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 1760 | warn \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1761 | ]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1762 | |
Darren Tucker | c61d5ec | 2017-02-03 14:10:34 +1100 | [diff] [blame] | 1763 | dnl Wide character support. |
Darren Tucker | a233358 | 2016-07-14 10:59:09 +1000 | [diff] [blame] | 1764 | AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) |
Darren Tucker | a233358 | 2016-07-14 10:59:09 +1000 | [diff] [blame] | 1765 | |
Darren Tucker | 10e290e | 2016-12-13 13:51:32 +1100 | [diff] [blame] | 1766 | TEST_SSH_UTF8=${TEST_SSH_UTF8:=yes} |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 1767 | AC_MSG_CHECKING([for utf8 locale support]) |
| 1768 | AC_RUN_IFELSE( |
| 1769 | [AC_LANG_PROGRAM([[ |
| 1770 | #include <locale.h> |
Darren Tucker | c359950 | 2016-12-09 12:52:02 +1100 | [diff] [blame] | 1771 | #include <stdlib.h> |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 1772 | ]], [[ |
| 1773 | char *loc = setlocale(LC_CTYPE, "en_US.UTF-8"); |
| 1774 | if (loc != NULL) |
| 1775 | exit(0); |
| 1776 | exit(1); |
| 1777 | ]])], |
| 1778 | AC_MSG_RESULT(yes), |
| 1779 | [AC_MSG_RESULT(no) |
| 1780 | TEST_SSH_UTF8=no], |
| 1781 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 1782 | ) |
| 1783 | |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1784 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1785 | [AC_LANG_PROGRAM( |
| 1786 | [[ #include <ctype.h> ]], |
| 1787 | [[ return (isblank('a')); ]])], |
| 1788 | [AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).]) |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1789 | ]) |
| 1790 | |
Damien Miller | 5fbe93f | 2016-07-15 13:54:31 +1000 | [diff] [blame] | 1791 | disable_pkcs11= |
| 1792 | AC_ARG_ENABLE([pkcs11], |
| 1793 | [ --disable-pkcs11 disable PKCS#11 support code [no]], |
| 1794 | [ |
| 1795 | if test "x$enableval" = "xno" ; then |
| 1796 | disable_pkcs11=1 |
| 1797 | fi |
| 1798 | ] |
| 1799 | ) |
| 1800 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1801 | # PKCS11 depends on OpenSSL. |
Damien Miller | 5fbe93f | 2016-07-15 13:54:31 +1000 | [diff] [blame] | 1802 | if test "x$openssl" = "xyes" && test "x$disable_pkcs11" = "x"; then |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1803 | # PKCS#11 support requires dlopen() and co |
| 1804 | AC_SEARCH_LIBS([dlopen], [dl], |
| 1805 | [AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])] |
| 1806 | ) |
| 1807 | fi |
Damien Miller | b3c9f78 | 2010-02-12 10:11:34 +1100 | [diff] [blame] | 1808 | |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1809 | # IRIX has a const char return value for gai_strerror() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1810 | AC_CHECK_FUNCS([gai_strerror], [ |
| 1811 | AC_DEFINE([HAVE_GAI_STRERROR]) |
| 1812 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1813 | #include <sys/types.h> |
| 1814 | #include <sys/socket.h> |
| 1815 | #include <netdb.h> |
| 1816 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1817 | const char *gai_strerror(int); |
| 1818 | ]], [[ |
| 1819 | char *str; |
| 1820 | str = gai_strerror(0); |
| 1821 | ]])], [ |
| 1822 | AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1], |
| 1823 | [Define if gai_strerror() returns const char *])], [])]) |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1824 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1825 | AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], |
| 1826 | [Some systems put nanosleep outside of libc])]) |
Damien Miller | cd6853c | 2003-01-28 11:33:42 +1100 | [diff] [blame] | 1827 | |
Darren Tucker | a710891 | 2013-06-02 08:18:31 +1000 | [diff] [blame] | 1828 | AC_SEARCH_LIBS([clock_gettime], [rt], |
| 1829 | [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) |
| 1830 | |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1831 | dnl Make sure prototypes are defined for these before using them. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1832 | AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])]) |
| 1833 | AC_CHECK_DECL([strsep], |
| 1834 | [AC_CHECK_FUNCS([strsep])], |
Darren Tucker | 390b6d5 | 2005-05-28 16:54:36 +1000 | [diff] [blame] | 1835 | [], |
| 1836 | [ |
| 1837 | #ifdef HAVE_STRING_H |
| 1838 | # include <string.h> |
| 1839 | #endif |
| 1840 | ]) |
Ben Lindstrom | 3e00647 | 2002-10-16 00:24:03 +0000 | [diff] [blame] | 1841 | |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1842 | dnl tcsendbreak might be a macro |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1843 | AC_CHECK_DECL([tcsendbreak], |
| 1844 | [AC_DEFINE([HAVE_TCSENDBREAK])], |
| 1845 | [AC_CHECK_FUNCS([tcsendbreak])], |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1846 | [#include <termios.h>] |
| 1847 | ) |
| 1848 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1849 | AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>]) |
Darren Tucker | 5bb1400 | 2004-04-23 18:53:10 +1000 | [diff] [blame] | 1850 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1851 | AC_CHECK_DECLS([SHUT_RD], , , |
Darren Tucker | 128a089 | 2006-07-12 19:02:56 +1000 | [diff] [blame] | 1852 | [ |
| 1853 | #include <sys/types.h> |
| 1854 | #include <sys/socket.h> |
| 1855 | ]) |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1856 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1857 | AC_CHECK_DECLS([O_NONBLOCK], , , |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1858 | [ |
| 1859 | #include <sys/types.h> |
| 1860 | #ifdef HAVE_SYS_STAT_H |
| 1861 | # include <sys/stat.h> |
| 1862 | #endif |
| 1863 | #ifdef HAVE_FCNTL_H |
| 1864 | # include <fcntl.h> |
| 1865 | #endif |
| 1866 | ]) |
| 1867 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1868 | AC_CHECK_DECLS([writev], , , [ |
Darren Tucker | ed0b592 | 2006-09-03 22:44:49 +1000 | [diff] [blame] | 1869 | #include <sys/types.h> |
| 1870 | #include <sys/uio.h> |
| 1871 | #include <unistd.h> |
| 1872 | ]) |
| 1873 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1874 | AC_CHECK_DECLS([MAXSYMLINKS], , , [ |
Darren Tucker | 6d862a5 | 2007-04-29 14:39:02 +1000 | [diff] [blame] | 1875 | #include <sys/param.h> |
| 1876 | ]) |
| 1877 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1878 | AC_CHECK_DECLS([offsetof], , , [ |
Darren Tucker | dca0edf | 2007-04-29 15:06:44 +1000 | [diff] [blame] | 1879 | #include <stddef.h> |
| 1880 | ]) |
| 1881 | |
Darren Tucker | c7aad00 | 2013-06-02 07:18:47 +1000 | [diff] [blame] | 1882 | # extra bits for select(2) |
| 1883 | AC_CHECK_DECLS([howmany, NFDBITS], [], [], [[ |
| 1884 | #include <sys/param.h> |
| 1885 | #include <sys/types.h> |
| 1886 | #ifdef HAVE_SYS_SYSMACROS_H |
| 1887 | #include <sys/sysmacros.h> |
| 1888 | #endif |
| 1889 | #ifdef HAVE_SYS_SELECT_H |
| 1890 | #include <sys/select.h> |
| 1891 | #endif |
| 1892 | #ifdef HAVE_SYS_TIME_H |
| 1893 | #include <sys/time.h> |
| 1894 | #endif |
| 1895 | #ifdef HAVE_UNISTD_H |
| 1896 | #include <unistd.h> |
| 1897 | #endif |
| 1898 | ]]) |
| 1899 | AC_CHECK_TYPES([fd_mask], [], [], [[ |
| 1900 | #include <sys/param.h> |
| 1901 | #include <sys/types.h> |
| 1902 | #ifdef HAVE_SYS_SELECT_H |
| 1903 | #include <sys/select.h> |
| 1904 | #endif |
| 1905 | #ifdef HAVE_SYS_TIME_H |
| 1906 | #include <sys/time.h> |
| 1907 | #endif |
| 1908 | #ifdef HAVE_UNISTD_H |
| 1909 | #include <unistd.h> |
| 1910 | #endif |
| 1911 | ]]) |
| 1912 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1913 | AC_CHECK_FUNCS([setresuid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1914 | dnl Some platorms have setresuid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1915 | AC_MSG_CHECKING([if setresuid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1916 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1917 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1918 | #include <stdlib.h> |
| 1919 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1920 | ]], [[ |
| 1921 | errno=0; |
| 1922 | setresuid(0,0,0); |
| 1923 | if (errno==ENOSYS) |
| 1924 | exit(1); |
| 1925 | else |
| 1926 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1927 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1928 | [AC_MSG_RESULT([yes])], |
| 1929 | [AC_DEFINE([BROKEN_SETRESUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1930 | [Define if your setresuid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1931 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1932 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1933 | ) |
| 1934 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1935 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1936 | AC_CHECK_FUNCS([setresgid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1937 | dnl Some platorms have setresgid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1938 | AC_MSG_CHECKING([if setresgid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1939 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1940 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1941 | #include <stdlib.h> |
| 1942 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1943 | ]], [[ |
| 1944 | errno=0; |
| 1945 | setresgid(0,0,0); |
| 1946 | if (errno==ENOSYS) |
| 1947 | exit(1); |
| 1948 | else |
| 1949 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1950 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1951 | [AC_MSG_RESULT([yes])], |
| 1952 | [AC_DEFINE([BROKEN_SETRESGID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1953 | [Define if your setresgid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1954 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1955 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1956 | ) |
| 1957 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1958 | |
Darren Tucker | d3e2aee | 2015-07-17 12:52:34 +1000 | [diff] [blame] | 1959 | AC_CHECK_FUNCS([realpath], [ |
| 1960 | dnl the sftp v3 spec says SSH_FXP_REALPATH will "canonicalize any given |
| 1961 | dnl path name", however some implementations of realpath (and some |
| 1962 | dnl versions of the POSIX spec) do not work on non-existent files, |
| 1963 | dnl so we use the OpenBSD implementation on those platforms. |
| 1964 | AC_MSG_CHECKING([if realpath works with non-existent files]) |
| 1965 | AC_RUN_IFELSE( |
| 1966 | [AC_LANG_PROGRAM([[ |
| 1967 | #include <limits.h> |
| 1968 | #include <stdlib.h> |
| 1969 | #include <errno.h> |
| 1970 | ]], [[ |
| 1971 | char buf[PATH_MAX]; |
| 1972 | if (realpath("/opensshnonexistentfilename1234", buf) == NULL) |
| 1973 | if (errno == ENOENT) |
| 1974 | exit(1); |
| 1975 | exit(0); |
| 1976 | ]])], |
| 1977 | [AC_MSG_RESULT([yes])], |
| 1978 | [AC_DEFINE([BROKEN_REALPATH], [1], |
| 1979 | [realpath does not work with nonexistent files]) |
| 1980 | AC_MSG_RESULT([no])], |
| 1981 | [AC_MSG_WARN([cross compiling: assuming working])] |
| 1982 | ) |
| 1983 | ]) |
| 1984 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1985 | dnl Checks for time functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1986 | AC_CHECK_FUNCS([gettimeofday time]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1987 | dnl Checks for utmp functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1988 | AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent]) |
| 1989 | AC_CHECK_FUNCS([utmpname]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1990 | dnl Checks for utmpx functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1991 | AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline getutxuser pututxline]) |
| 1992 | AC_CHECK_FUNCS([setutxdb setutxent utmpxname]) |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 1993 | dnl Checks for lastlog functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1994 | AC_CHECK_FUNCS([getlastlogxbyname]) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 1995 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1996 | AC_CHECK_FUNC([daemon], |
| 1997 | [AC_DEFINE([HAVE_DAEMON], [1], [Define if your libraries define daemon()])], |
| 1998 | [AC_CHECK_LIB([bsd], [daemon], |
| 1999 | [LIBS="$LIBS -lbsd"; AC_DEFINE([HAVE_DAEMON])])] |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 2000 | ) |
| 2001 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2002 | AC_CHECK_FUNC([getpagesize], |
| 2003 | [AC_DEFINE([HAVE_GETPAGESIZE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2004 | [Define if your libraries define getpagesize()])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2005 | [AC_CHECK_LIB([ucb], [getpagesize], |
| 2006 | [LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])] |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 2007 | ) |
| 2008 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2009 | # Check for broken snprintf |
| 2010 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 2011 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2012 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2013 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 2014 | [[ |
| 2015 | char b[5]; |
| 2016 | snprintf(b,5,"123456789"); |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 2017 | exit(b[4]!='\0'); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2018 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2019 | [AC_MSG_RESULT([yes])], |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2020 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2021 | AC_MSG_RESULT([no]) |
| 2022 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2023 | [Define if your snprintf is busted]) |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2024 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2025 | ], |
| 2026 | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2027 | ) |
| 2028 | fi |
| 2029 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2030 | # We depend on vsnprintf returning the right thing on overflow: the |
| 2031 | # number of characters it tried to create (as per SUSv3) |
| 2032 | if test "x$ac_cv_func_vsnprintf" = "xyes" ; then |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2033 | AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) |
| 2034 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2035 | [AC_LANG_PROGRAM([[ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2036 | #include <sys/types.h> |
| 2037 | #include <stdio.h> |
| 2038 | #include <stdarg.h> |
| 2039 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2040 | int x_snprintf(char *str, size_t count, const char *fmt, ...) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2041 | { |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2042 | size_t ret; |
| 2043 | va_list ap; |
| 2044 | |
| 2045 | va_start(ap, fmt); |
| 2046 | ret = vsnprintf(str, count, fmt, ap); |
| 2047 | va_end(ap); |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2048 | return ret; |
| 2049 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2050 | ]], [[ |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2051 | char x[1]; |
| 2052 | if (x_snprintf(x, 1, "%s %d", "hello", 12345) != 11) |
| 2053 | return 1; |
| 2054 | if (x_snprintf(NULL, 0, "%s %d", "hello", 12345) != 11) |
| 2055 | return 1; |
| 2056 | return 0; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2057 | ]])], |
| 2058 | [AC_MSG_RESULT([yes])], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2059 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2060 | AC_MSG_RESULT([no]) |
| 2061 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2062 | [Define if your snprintf is busted]) |
| 2063 | AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor]) |
| 2064 | ], |
| 2065 | [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ] |
| 2066 | ) |
| 2067 | fi |
| 2068 | |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2069 | # On systems where [v]snprintf is broken, but is declared in stdio, |
| 2070 | # check that the fmt argument is const char * or just char *. |
| 2071 | # This is only useful for when BROKEN_SNPRINTF |
| 2072 | AC_MSG_CHECKING([whether snprintf can declare const char *fmt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2073 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2074 | #include <stdio.h> |
| 2075 | int snprintf(char *a, size_t b, const char *c, ...) { return 0; } |
| 2076 | ]], [[ |
| 2077 | snprintf(0, 0, 0); |
| 2078 | ]])], |
| 2079 | [AC_MSG_RESULT([yes]) |
| 2080 | AC_DEFINE([SNPRINTF_CONST], [const], |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2081 | [Define as const if snprintf() can declare const char *fmt])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2082 | [AC_MSG_RESULT([no]) |
| 2083 | AC_DEFINE([SNPRINTF_CONST], [/* not const */])]) |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2084 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 2085 | # Check for missing getpeereid (or equiv) support |
| 2086 | NO_PEERCHECK="" |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 2087 | 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] | 2088 | AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2089 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2090 | #include <sys/types.h> |
| 2091 | #include <sys/socket.h>]], [[int i = SO_PEERCRED;]])], |
| 2092 | [ AC_MSG_RESULT([yes]) |
| 2093 | AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have PEERCRED socket option]) |
| 2094 | ], [AC_MSG_RESULT([no]) |
| 2095 | NO_PEERCHECK=1 |
| 2096 | ]) |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 2097 | fi |
| 2098 | |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2099 | dnl see whether mkstemp() requires XXXXXX |
| 2100 | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then |
| 2101 | AC_MSG_CHECKING([for (overly) strict mkstemp]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2102 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2103 | [AC_LANG_PROGRAM([[ |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2104 | #include <stdlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2105 | ]], [[ |
| 2106 | char template[]="conftest.mkstemp-test"; |
| 2107 | if (mkstemp(template) == -1) |
| 2108 | exit(1); |
| 2109 | unlink(template); |
| 2110 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2111 | ]])], |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2112 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2113 | AC_MSG_RESULT([no]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2114 | ], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2115 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2116 | AC_MSG_RESULT([yes]) |
| 2117 | AC_DEFINE([HAVE_STRICT_MKSTEMP], [1], [Silly mkstemp()]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2118 | ], |
| 2119 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2120 | AC_MSG_RESULT([yes]) |
| 2121 | AC_DEFINE([HAVE_STRICT_MKSTEMP]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2122 | ] |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2123 | ) |
| 2124 | fi |
| 2125 | |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2126 | dnl make sure that openpty does not reacquire controlling terminal |
| 2127 | if test ! -z "$check_for_openpty_ctty_bug"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2128 | AC_MSG_CHECKING([if openpty correctly handles controlling tty]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2129 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2130 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2131 | #include <stdio.h> |
| 2132 | #include <sys/fcntl.h> |
| 2133 | #include <sys/types.h> |
| 2134 | #include <sys/wait.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2135 | ]], [[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2136 | pid_t pid; |
| 2137 | int fd, ptyfd, ttyfd, status; |
| 2138 | |
| 2139 | pid = fork(); |
| 2140 | if (pid < 0) { /* failed */ |
| 2141 | exit(1); |
| 2142 | } else if (pid > 0) { /* parent */ |
| 2143 | waitpid(pid, &status, 0); |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2144 | if (WIFEXITED(status)) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2145 | exit(WEXITSTATUS(status)); |
| 2146 | else |
| 2147 | exit(2); |
| 2148 | } else { /* child */ |
| 2149 | close(0); close(1); close(2); |
| 2150 | setsid(); |
| 2151 | openpty(&ptyfd, &ttyfd, NULL, NULL, NULL); |
| 2152 | fd = open("/dev/tty", O_RDWR | O_NOCTTY); |
| 2153 | if (fd >= 0) |
| 2154 | exit(3); /* Acquired ctty: broken */ |
| 2155 | else |
| 2156 | exit(0); /* Did not acquire ctty: OK */ |
| 2157 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2158 | ]])], |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2159 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2160 | AC_MSG_RESULT([yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2161 | ], |
| 2162 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2163 | AC_MSG_RESULT([no]) |
| 2164 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2165 | ], |
| 2166 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2167 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2168 | ] |
| 2169 | ) |
| 2170 | fi |
| 2171 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2172 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2173 | test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2174 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2175 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2176 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2177 | #include <stdio.h> |
| 2178 | #include <sys/socket.h> |
| 2179 | #include <netdb.h> |
| 2180 | #include <errno.h> |
| 2181 | #include <netinet/in.h> |
| 2182 | |
| 2183 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2184 | ]], [[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2185 | int err, sock; |
| 2186 | struct addrinfo *gai_ai, *ai, hints; |
| 2187 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2188 | |
| 2189 | memset(&hints, 0, sizeof(hints)); |
| 2190 | hints.ai_family = PF_UNSPEC; |
| 2191 | hints.ai_socktype = SOCK_STREAM; |
| 2192 | hints.ai_flags = AI_PASSIVE; |
| 2193 | |
| 2194 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2195 | if (err != 0) { |
| 2196 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2197 | exit(1); |
| 2198 | } |
| 2199 | |
| 2200 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2201 | if (ai->ai_family != AF_INET6) |
| 2202 | continue; |
| 2203 | |
| 2204 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2205 | sizeof(ntop), strport, sizeof(strport), |
| 2206 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2207 | |
| 2208 | if (err != 0) { |
| 2209 | if (err == EAI_SYSTEM) |
| 2210 | perror("getnameinfo EAI_SYSTEM"); |
| 2211 | else |
| 2212 | fprintf(stderr, "getnameinfo failed: %s\n", |
| 2213 | gai_strerror(err)); |
| 2214 | exit(2); |
| 2215 | } |
| 2216 | |
| 2217 | sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
| 2218 | if (sock < 0) |
| 2219 | perror("socket"); |
| 2220 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
| 2221 | if (errno == EBADF) |
| 2222 | exit(3); |
| 2223 | } |
| 2224 | } |
| 2225 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2226 | ]])], |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2227 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2228 | AC_MSG_RESULT([yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2229 | ], |
| 2230 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2231 | AC_MSG_RESULT([no]) |
| 2232 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2233 | ], |
| 2234 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2235 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2236 | ] |
| 2237 | ) |
| 2238 | fi |
| 2239 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2240 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2241 | test "x$check_for_aix_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2242 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2243 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2244 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2245 | #include <stdio.h> |
| 2246 | #include <sys/socket.h> |
| 2247 | #include <netdb.h> |
| 2248 | #include <errno.h> |
| 2249 | #include <netinet/in.h> |
| 2250 | |
| 2251 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2252 | ]], [[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2253 | int err, sock; |
| 2254 | struct addrinfo *gai_ai, *ai, hints; |
| 2255 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2256 | |
| 2257 | memset(&hints, 0, sizeof(hints)); |
| 2258 | hints.ai_family = PF_UNSPEC; |
| 2259 | hints.ai_socktype = SOCK_STREAM; |
| 2260 | hints.ai_flags = AI_PASSIVE; |
| 2261 | |
| 2262 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2263 | if (err != 0) { |
| 2264 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2265 | exit(1); |
| 2266 | } |
| 2267 | |
| 2268 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2269 | if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) |
| 2270 | continue; |
| 2271 | |
| 2272 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2273 | sizeof(ntop), strport, sizeof(strport), |
| 2274 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2275 | |
| 2276 | if (ai->ai_family == AF_INET && err != 0) { |
| 2277 | perror("getnameinfo"); |
| 2278 | exit(2); |
| 2279 | } |
| 2280 | } |
| 2281 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2282 | ]])], |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2283 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2284 | AC_MSG_RESULT([yes]) |
| 2285 | AC_DEFINE([AIX_GETNAMEINFO_HACK], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2286 | [Define if you have a getaddrinfo that fails |
| 2287 | for the all-zeros IPv6 address]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2288 | ], |
| 2289 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2290 | AC_MSG_RESULT([no]) |
| 2291 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2292 | ], |
Darren Tucker | 8b272ab | 2006-06-27 11:20:28 +1000 | [diff] [blame] | 2293 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2294 | AC_MSG_RESULT([cross-compiling, assuming no]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2295 | ] |
| 2296 | ) |
| 2297 | fi |
| 2298 | |
Darren Tucker | e50e8c9 | 2015-02-21 15:10:33 +1100 | [diff] [blame] | 2299 | if test "x$ac_cv_func_getaddrinfo" = "xyes"; then |
| 2300 | AC_CHECK_DECLS(AI_NUMERICSERV, , , |
| 2301 | [#include <sys/types.h> |
| 2302 | #include <sys/socket.h> |
| 2303 | #include <netdb.h>]) |
| 2304 | fi |
| 2305 | |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2306 | if test "x$check_for_conflicting_getspnam" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2307 | AC_MSG_CHECKING([for conflicting getspnam in shadow.h]) |
| 2308 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]], |
| 2309 | [[ exit(0); ]])], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2310 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2311 | AC_MSG_RESULT([no]) |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2312 | ], |
| 2313 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2314 | AC_MSG_RESULT([yes]) |
| 2315 | AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2316 | [Conflicting defs for getspnam]) |
| 2317 | ] |
| 2318 | ) |
| 2319 | fi |
| 2320 | |
Darren Tucker | 20e5e8b | 2016-08-02 12:16:34 +1000 | [diff] [blame] | 2321 | dnl NetBSD added an strnvis and unfortunately made it incompatible with the |
| 2322 | dnl existing one in OpenBSD and Linux's libbsd (the former having existed |
| 2323 | dnl for over ten years). Despite this incompatibility being reported during |
| 2324 | dnl development (see http://gnats.netbsd.org/44977) they still shipped it. |
| 2325 | dnl Even more unfortunately FreeBSD and later MacOS picked up this incompatible |
| 2326 | dnl implementation. Try to detect this mess, and assume the only safe option |
| 2327 | dnl if we're cross compiling. |
| 2328 | dnl |
| 2329 | dnl OpenBSD, 2001: strnvis(char *dst, const char *src, size_t dlen, int flag); |
| 2330 | dnl NetBSD: 2012, strnvis(char *dst, size_t dlen, const char *src, int flag); |
| 2331 | if test "x$ac_cv_func_strnvis" = "xyes"; then |
| 2332 | AC_MSG_CHECKING([for working strnvis]) |
| 2333 | AC_RUN_IFELSE( |
| 2334 | [AC_LANG_PROGRAM([[ |
| 2335 | #include <signal.h> |
| 2336 | #include <stdlib.h> |
| 2337 | #include <string.h> |
| 2338 | #include <vis.h> |
| 2339 | static void sighandler(int sig) { _exit(1); } |
| 2340 | ]], [[ |
| 2341 | char dst[16]; |
| 2342 | |
| 2343 | signal(SIGSEGV, sighandler); |
| 2344 | if (strnvis(dst, "src", 4, 0) && strcmp(dst, "src") == 0) |
| 2345 | exit(0); |
| 2346 | exit(1) |
| 2347 | ]])], |
| 2348 | [AC_MSG_RESULT([yes])], |
| 2349 | [AC_MSG_RESULT([no]) |
| 2350 | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis detected broken])], |
| 2351 | [AC_MSG_WARN([cross compiling: assuming broken]) |
| 2352 | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis assumed broken])] |
| 2353 | ) |
| 2354 | fi |
| 2355 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 2356 | AC_FUNC_GETPGRP |
| 2357 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2358 | # Search for OpenSSL |
| 2359 | saved_CPPFLAGS="$CPPFLAGS" |
| 2360 | saved_LDFLAGS="$LDFLAGS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2361 | AC_ARG_WITH([ssl-dir], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2362 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 2363 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2364 | if test "x$openssl" = "xno" ; then |
| 2365 | AC_MSG_ERROR([cannot use --with-ssl-dir when OpenSSL disabled]) |
| 2366 | fi |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 2367 | if test "x$withval" != "xno" ; then |
Darren Tucker | c7e38d5 | 2005-02-09 22:12:30 +1100 | [diff] [blame] | 2368 | case "$withval" in |
| 2369 | # Relative paths |
| 2370 | ./*|../*) withval="`pwd`/$withval" |
| 2371 | esac |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2372 | if test -d "$withval/lib"; then |
| 2373 | if test -n "${need_dash_r}"; then |
| 2374 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 2375 | else |
| 2376 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 2377 | fi |
Darren Tucker | 9f8703b | 2010-04-23 11:12:06 +1000 | [diff] [blame] | 2378 | elif test -d "$withval/lib64"; then |
| 2379 | if test -n "${need_dash_r}"; then |
| 2380 | LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}" |
| 2381 | else |
| 2382 | LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" |
| 2383 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2384 | else |
| 2385 | if test -n "${need_dash_r}"; then |
| 2386 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
| 2387 | else |
| 2388 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 2389 | fi |
| 2390 | fi |
| 2391 | if test -d "$withval/include"; then |
| 2392 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 2393 | else |
| 2394 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 2395 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2396 | fi |
| 2397 | ] |
| 2398 | ) |
Damien Miller | b9c5667 | 2014-05-15 14:43:37 +1000 | [diff] [blame] | 2399 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2400 | AC_ARG_WITH([openssl-header-check], |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2401 | [ --without-openssl-header-check Disable OpenSSL version consistency check], |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2402 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2403 | if test "x$withval" = "xno" ; then |
| 2404 | openssl_check_nonfatal=1 |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2405 | fi |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2406 | ] |
| 2407 | ) |
| 2408 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2409 | openssl_engine=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2410 | AC_ARG_WITH([ssl-engine], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2411 | [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2412 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2413 | if test "x$withval" != "xno" ; then |
Darren Tucker | b5fa0cd | 2015-12-15 15:10:32 +1100 | [diff] [blame] | 2414 | if test "x$openssl" = "xno" ; then |
| 2415 | AC_MSG_ERROR([cannot use --with-ssl-engine when OpenSSL disabled]) |
| 2416 | fi |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2417 | openssl_engine=yes |
| 2418 | fi |
| 2419 | ] |
| 2420 | ) |
| 2421 | |
| 2422 | if test "x$openssl" = "xyes" ; then |
| 2423 | LIBS="-lcrypto $LIBS" |
| 2424 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL], [1], |
| 2425 | [Define if your ssl headers are included |
| 2426 | with #include <openssl/header.h>])], |
| 2427 | [ |
| 2428 | dnl Check default openssl install dir |
| 2429 | if test -n "${need_dash_r}"; then |
| 2430 | LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}" |
| 2431 | else |
| 2432 | LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" |
| 2433 | fi |
| 2434 | CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" |
| 2435 | AC_CHECK_HEADER([openssl/opensslv.h], , |
| 2436 | [AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])]) |
| 2437 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL])], |
| 2438 | [ |
| 2439 | AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) |
| 2440 | ] |
| 2441 | ) |
| 2442 | ] |
| 2443 | ) |
| 2444 | |
| 2445 | # Determine OpenSSL header version |
| 2446 | AC_MSG_CHECKING([OpenSSL header version]) |
| 2447 | AC_RUN_IFELSE( |
| 2448 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 1560596 | 2015-11-10 11:14:47 +1100 | [diff] [blame] | 2449 | #include <stdlib.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2450 | #include <stdio.h> |
| 2451 | #include <string.h> |
| 2452 | #include <openssl/opensslv.h> |
| 2453 | #define DATA "conftest.sslincver" |
| 2454 | ]], [[ |
| 2455 | FILE *fd; |
| 2456 | int rc; |
| 2457 | |
| 2458 | fd = fopen(DATA,"w"); |
| 2459 | if(fd == NULL) |
| 2460 | exit(1); |
| 2461 | |
Darren Tucker | b341353 | 2016-04-04 11:09:21 +1000 | [diff] [blame] | 2462 | if ((rc = fprintf(fd, "%08lx (%s)\n", |
| 2463 | (unsigned long)OPENSSL_VERSION_NUMBER, |
| 2464 | OPENSSL_VERSION_TEXT)) < 0) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2465 | exit(1); |
| 2466 | |
| 2467 | exit(0); |
| 2468 | ]])], |
| 2469 | [ |
| 2470 | ssl_header_ver=`cat conftest.sslincver` |
| 2471 | AC_MSG_RESULT([$ssl_header_ver]) |
| 2472 | ], |
| 2473 | [ |
| 2474 | AC_MSG_RESULT([not found]) |
| 2475 | AC_MSG_ERROR([OpenSSL version header not found.]) |
| 2476 | ], |
| 2477 | [ |
| 2478 | AC_MSG_WARN([cross compiling: not checking]) |
| 2479 | ] |
| 2480 | ) |
| 2481 | |
| 2482 | # Determine OpenSSL library version |
| 2483 | AC_MSG_CHECKING([OpenSSL library version]) |
| 2484 | AC_RUN_IFELSE( |
| 2485 | [AC_LANG_PROGRAM([[ |
| 2486 | #include <stdio.h> |
| 2487 | #include <string.h> |
| 2488 | #include <openssl/opensslv.h> |
| 2489 | #include <openssl/crypto.h> |
| 2490 | #define DATA "conftest.ssllibver" |
| 2491 | ]], [[ |
| 2492 | FILE *fd; |
| 2493 | int rc; |
| 2494 | |
| 2495 | fd = fopen(DATA,"w"); |
| 2496 | if(fd == NULL) |
| 2497 | exit(1); |
| 2498 | |
Darren Tucker | 815bcac | 2016-04-04 11:07:59 +1000 | [diff] [blame] | 2499 | if ((rc = fprintf(fd, "%08lx (%s)\n", (unsigned long)SSLeay(), |
| 2500 | SSLeay_version(SSLEAY_VERSION))) < 0) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2501 | exit(1); |
| 2502 | |
| 2503 | exit(0); |
| 2504 | ]])], |
| 2505 | [ |
| 2506 | ssl_library_ver=`cat conftest.ssllibver` |
| 2507 | # Check version is supported. |
| 2508 | case "$ssl_library_ver" in |
Damien Miller | 2429cf7 | 2017-03-14 18:01:52 +1100 | [diff] [blame] | 2509 | 10000*|0*) |
| 2510 | AC_MSG_ERROR([OpenSSL >= 1.0.1 required (have "$ssl_library_ver")]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2511 | ;; |
| 2512 | *) ;; |
| 2513 | esac |
| 2514 | AC_MSG_RESULT([$ssl_library_ver]) |
| 2515 | ], |
| 2516 | [ |
| 2517 | AC_MSG_RESULT([not found]) |
| 2518 | AC_MSG_ERROR([OpenSSL library not found.]) |
| 2519 | ], |
| 2520 | [ |
| 2521 | AC_MSG_WARN([cross compiling: not checking]) |
| 2522 | ] |
| 2523 | ) |
| 2524 | |
| 2525 | # Sanity check OpenSSL headers |
| 2526 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
| 2527 | AC_RUN_IFELSE( |
| 2528 | [AC_LANG_PROGRAM([[ |
| 2529 | #include <string.h> |
| 2530 | #include <openssl/opensslv.h> |
Darren Tucker | c1d7e54 | 2015-12-15 14:27:09 +1100 | [diff] [blame] | 2531 | #include <openssl/crypto.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2532 | ]], [[ |
| 2533 | exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); |
| 2534 | ]])], |
| 2535 | [ |
| 2536 | AC_MSG_RESULT([yes]) |
| 2537 | ], |
| 2538 | [ |
| 2539 | AC_MSG_RESULT([no]) |
| 2540 | if test "x$openssl_check_nonfatal" = "x"; then |
| 2541 | AC_MSG_ERROR([Your OpenSSL headers do not match your |
| 2542 | library. Check config.log for details. |
| 2543 | If you are sure your installation is consistent, you can disable the check |
| 2544 | by running "./configure --without-openssl-header-check". |
| 2545 | Also see contrib/findssl.sh for help identifying header/library mismatches. |
| 2546 | ]) |
| 2547 | else |
| 2548 | AC_MSG_WARN([Your OpenSSL headers do not match your |
| 2549 | library. Check config.log for details. |
| 2550 | Also see contrib/findssl.sh for help identifying header/library mismatches.]) |
| 2551 | fi |
| 2552 | ], |
| 2553 | [ |
| 2554 | AC_MSG_WARN([cross compiling: not checking]) |
| 2555 | ] |
| 2556 | ) |
| 2557 | |
| 2558 | AC_MSG_CHECKING([if programs using OpenSSL functions will link]) |
| 2559 | AC_LINK_IFELSE( |
| 2560 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2561 | [[ SSLeay_add_all_algorithms(); ]])], |
| 2562 | [ |
| 2563 | AC_MSG_RESULT([yes]) |
| 2564 | ], |
| 2565 | [ |
| 2566 | AC_MSG_RESULT([no]) |
| 2567 | saved_LIBS="$LIBS" |
| 2568 | LIBS="$LIBS -ldl" |
| 2569 | AC_MSG_CHECKING([if programs using OpenSSL need -ldl]) |
| 2570 | AC_LINK_IFELSE( |
| 2571 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2572 | [[ SSLeay_add_all_algorithms(); ]])], |
| 2573 | [ |
| 2574 | AC_MSG_RESULT([yes]) |
| 2575 | ], |
| 2576 | [ |
| 2577 | AC_MSG_RESULT([no]) |
| 2578 | LIBS="$saved_LIBS" |
| 2579 | ] |
| 2580 | ) |
| 2581 | ] |
| 2582 | ) |
| 2583 | |
| 2584 | AC_CHECK_FUNCS([ \ |
| 2585 | BN_is_prime_ex \ |
| 2586 | DSA_generate_parameters_ex \ |
| 2587 | EVP_DigestInit_ex \ |
| 2588 | EVP_DigestFinal_ex \ |
| 2589 | EVP_MD_CTX_init \ |
| 2590 | EVP_MD_CTX_cleanup \ |
| 2591 | EVP_MD_CTX_copy_ex \ |
| 2592 | HMAC_CTX_init \ |
| 2593 | RSA_generate_key_ex \ |
| 2594 | RSA_get_default_method \ |
| 2595 | ]) |
| 2596 | |
| 2597 | if test "x$openssl_engine" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2598 | AC_MSG_CHECKING([for OpenSSL ENGINE support]) |
| 2599 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2600 | #include <openssl/engine.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2601 | ]], [[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2602 | ENGINE_load_builtin_engines(); |
| 2603 | ENGINE_register_all_complete(); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2604 | ]])], |
| 2605 | [ AC_MSG_RESULT([yes]) |
| 2606 | AC_DEFINE([USE_OPENSSL_ENGINE], [1], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2607 | [Enable OpenSSL engine support]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2608 | ], [ AC_MSG_ERROR([OpenSSL ENGINE support not found]) |
| 2609 | ]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2610 | fi |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2611 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2612 | # Check for OpenSSL without EVP_aes_{192,256}_cbc |
| 2613 | AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) |
| 2614 | AC_LINK_IFELSE( |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2615 | [AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2616 | #include <string.h> |
| 2617 | #include <openssl/evp.h> |
| 2618 | ]], [[ |
| 2619 | exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL); |
| 2620 | ]])], |
| 2621 | [ |
| 2622 | AC_MSG_RESULT([no]) |
| 2623 | ], |
| 2624 | [ |
| 2625 | AC_MSG_RESULT([yes]) |
| 2626 | AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1], |
| 2627 | [libcrypto is missing AES 192 and 256 bit functions]) |
| 2628 | ] |
| 2629 | ) |
| 2630 | |
| 2631 | # Check for OpenSSL with EVP_aes_*ctr |
| 2632 | AC_MSG_CHECKING([whether OpenSSL has AES CTR via EVP]) |
| 2633 | AC_LINK_IFELSE( |
| 2634 | [AC_LANG_PROGRAM([[ |
| 2635 | #include <string.h> |
| 2636 | #include <openssl/evp.h> |
| 2637 | ]], [[ |
| 2638 | exit(EVP_aes_128_ctr() == NULL || |
| 2639 | EVP_aes_192_cbc() == NULL || |
| 2640 | EVP_aes_256_cbc() == NULL); |
| 2641 | ]])], |
| 2642 | [ |
| 2643 | AC_MSG_RESULT([yes]) |
| 2644 | AC_DEFINE([OPENSSL_HAVE_EVPCTR], [1], |
| 2645 | [libcrypto has EVP AES CTR]) |
| 2646 | ], |
| 2647 | [ |
| 2648 | AC_MSG_RESULT([no]) |
| 2649 | ] |
| 2650 | ) |
| 2651 | |
| 2652 | # Check for OpenSSL with EVP_aes_*gcm |
| 2653 | AC_MSG_CHECKING([whether OpenSSL has AES GCM via EVP]) |
| 2654 | AC_LINK_IFELSE( |
| 2655 | [AC_LANG_PROGRAM([[ |
| 2656 | #include <string.h> |
| 2657 | #include <openssl/evp.h> |
| 2658 | ]], [[ |
| 2659 | exit(EVP_aes_128_gcm() == NULL || |
| 2660 | EVP_aes_256_gcm() == NULL || |
| 2661 | EVP_CTRL_GCM_SET_IV_FIXED == 0 || |
| 2662 | EVP_CTRL_GCM_IV_GEN == 0 || |
| 2663 | EVP_CTRL_GCM_SET_TAG == 0 || |
| 2664 | EVP_CTRL_GCM_GET_TAG == 0 || |
| 2665 | EVP_CIPHER_CTX_ctrl(NULL, 0, 0, NULL) == 0); |
| 2666 | ]])], |
| 2667 | [ |
| 2668 | AC_MSG_RESULT([yes]) |
| 2669 | AC_DEFINE([OPENSSL_HAVE_EVPGCM], [1], |
| 2670 | [libcrypto has EVP AES GCM]) |
| 2671 | ], |
| 2672 | [ |
| 2673 | AC_MSG_RESULT([no]) |
| 2674 | unsupported_algorithms="$unsupported_cipers \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2675 | aes128-gcm@openssh.com \ |
| 2676 | aes256-gcm@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2677 | ] |
| 2678 | ) |
| 2679 | |
| 2680 | AC_SEARCH_LIBS([EVP_CIPHER_CTX_ctrl], [crypto], |
| 2681 | [AC_DEFINE([HAVE_EVP_CIPHER_CTX_CTRL], [1], |
| 2682 | [Define if libcrypto has EVP_CIPHER_CTX_ctrl])]) |
| 2683 | |
| 2684 | AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) |
| 2685 | AC_LINK_IFELSE( |
| 2686 | [AC_LANG_PROGRAM([[ |
| 2687 | #include <string.h> |
| 2688 | #include <openssl/evp.h> |
| 2689 | ]], [[ |
| 2690 | if(EVP_DigestUpdate(NULL, NULL,0)) |
| 2691 | exit(0); |
| 2692 | ]])], |
| 2693 | [ |
| 2694 | AC_MSG_RESULT([yes]) |
| 2695 | ], |
| 2696 | [ |
| 2697 | AC_MSG_RESULT([no]) |
| 2698 | AC_DEFINE([OPENSSL_EVP_DIGESTUPDATE_VOID], [1], |
| 2699 | [Define if EVP_DigestUpdate returns void]) |
| 2700 | ] |
| 2701 | ) |
| 2702 | |
| 2703 | # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, |
| 2704 | # because the system crypt() is more featureful. |
| 2705 | if test "x$check_for_libcrypt_before" = "x1"; then |
| 2706 | AC_CHECK_LIB([crypt], [crypt]) |
| 2707 | fi |
| 2708 | |
| 2709 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
| 2710 | # version in OpenSSL. |
| 2711 | if test "x$check_for_libcrypt_later" = "x1"; then |
| 2712 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
| 2713 | fi |
Damien Miller | 00797e8 | 2015-03-04 05:02:45 +1100 | [diff] [blame] | 2714 | AC_CHECK_FUNCS([crypt DES_crypt]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2715 | |
| 2716 | # Search for SHA256 support in libc and/or OpenSSL |
| 2717 | AC_CHECK_FUNCS([SHA256_Update EVP_sha256], , |
| 2718 | [unsupported_algorithms="$unsupported_algorithms \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2719 | hmac-sha2-256 \ |
| 2720 | hmac-sha2-512 \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2721 | diffie-hellman-group-exchange-sha256 \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2722 | hmac-sha2-256-etm@openssh.com \ |
| 2723 | hmac-sha2-512-etm@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2724 | ] |
| 2725 | ) |
| 2726 | # Search for RIPE-MD support in OpenSSL |
| 2727 | AC_CHECK_FUNCS([EVP_ripemd160], , |
| 2728 | [unsupported_algorithms="$unsupported_algorithms \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2729 | hmac-ripemd160 \ |
| 2730 | hmac-ripemd160@openssh.com \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2731 | hmac-ripemd160-etm@openssh.com" |
| 2732 | ] |
| 2733 | ) |
| 2734 | |
| 2735 | # Check complete ECC support in OpenSSL |
| 2736 | AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1]) |
| 2737 | AC_LINK_IFELSE( |
| 2738 | [AC_LANG_PROGRAM([[ |
| 2739 | #include <openssl/ec.h> |
| 2740 | #include <openssl/ecdh.h> |
| 2741 | #include <openssl/ecdsa.h> |
| 2742 | #include <openssl/evp.h> |
| 2743 | #include <openssl/objects.h> |
| 2744 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2745 | ]], [[ |
| 2746 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); |
| 2747 | const EVP_MD *m = EVP_sha256(); /* We need this too */ |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2748 | ]])], |
| 2749 | [ AC_MSG_RESULT([yes]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2750 | enable_nistp256=1 ], |
| 2751 | [ AC_MSG_RESULT([no]) ] |
| 2752 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2753 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2754 | AC_MSG_CHECKING([whether OpenSSL has NID_secp384r1]) |
| 2755 | AC_LINK_IFELSE( |
| 2756 | [AC_LANG_PROGRAM([[ |
| 2757 | #include <openssl/ec.h> |
| 2758 | #include <openssl/ecdh.h> |
| 2759 | #include <openssl/ecdsa.h> |
| 2760 | #include <openssl/evp.h> |
| 2761 | #include <openssl/objects.h> |
| 2762 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2763 | ]], [[ |
| 2764 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp384r1); |
| 2765 | const EVP_MD *m = EVP_sha384(); /* We need this too */ |
| 2766 | ]])], |
| 2767 | [ AC_MSG_RESULT([yes]) |
| 2768 | enable_nistp384=1 ], |
| 2769 | [ AC_MSG_RESULT([no]) ] |
| 2770 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2771 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2772 | AC_MSG_CHECKING([whether OpenSSL has NID_secp521r1]) |
| 2773 | AC_LINK_IFELSE( |
| 2774 | [AC_LANG_PROGRAM([[ |
| 2775 | #include <openssl/ec.h> |
| 2776 | #include <openssl/ecdh.h> |
| 2777 | #include <openssl/ecdsa.h> |
| 2778 | #include <openssl/evp.h> |
| 2779 | #include <openssl/objects.h> |
| 2780 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2781 | ]], [[ |
| 2782 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2783 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2784 | ]])], |
| 2785 | [ AC_MSG_RESULT([yes]) |
| 2786 | AC_MSG_CHECKING([if OpenSSL's NID_secp521r1 is functional]) |
| 2787 | AC_RUN_IFELSE( |
| 2788 | [AC_LANG_PROGRAM([[ |
| 2789 | #include <openssl/ec.h> |
| 2790 | #include <openssl/ecdh.h> |
| 2791 | #include <openssl/ecdsa.h> |
| 2792 | #include <openssl/evp.h> |
| 2793 | #include <openssl/objects.h> |
| 2794 | #include <openssl/opensslv.h> |
| 2795 | ]],[[ |
| 2796 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2797 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2798 | exit(e == NULL || m == NULL); |
| 2799 | ]])], |
| 2800 | [ AC_MSG_RESULT([yes]) |
| 2801 | enable_nistp521=1 ], |
| 2802 | [ AC_MSG_RESULT([no]) ], |
| 2803 | [ AC_MSG_WARN([cross-compiling: assuming yes]) |
| 2804 | enable_nistp521=1 ] |
| 2805 | )], |
| 2806 | AC_MSG_RESULT([no]) |
| 2807 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2808 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2809 | COMMENT_OUT_ECC="#no ecc#" |
| 2810 | TEST_SSH_ECC=no |
| 2811 | |
| 2812 | if test x$enable_nistp256 = x1 || test x$enable_nistp384 = x1 || \ |
| 2813 | test x$enable_nistp521 = x1; then |
| 2814 | AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) |
| 2815 | fi |
| 2816 | if test x$enable_nistp256 = x1; then |
| 2817 | AC_DEFINE([OPENSSL_HAS_NISTP256], [1], |
| 2818 | [libcrypto has NID_X9_62_prime256v1]) |
| 2819 | TEST_SSH_ECC=yes |
| 2820 | COMMENT_OUT_ECC="" |
| 2821 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2822 | unsupported_algorithms="$unsupported_algorithms \ |
| 2823 | ecdsa-sha2-nistp256 \ |
| 2824 | ecdh-sha2-nistp256 \ |
| 2825 | ecdsa-sha2-nistp256-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2826 | fi |
| 2827 | if test x$enable_nistp384 = x1; then |
| 2828 | AC_DEFINE([OPENSSL_HAS_NISTP384], [1], [libcrypto has NID_secp384r1]) |
| 2829 | TEST_SSH_ECC=yes |
| 2830 | COMMENT_OUT_ECC="" |
| 2831 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2832 | unsupported_algorithms="$unsupported_algorithms \ |
| 2833 | ecdsa-sha2-nistp384 \ |
| 2834 | ecdh-sha2-nistp384 \ |
| 2835 | ecdsa-sha2-nistp384-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2836 | fi |
| 2837 | if test x$enable_nistp521 = x1; then |
| 2838 | AC_DEFINE([OPENSSL_HAS_NISTP521], [1], [libcrypto has NID_secp521r1]) |
| 2839 | TEST_SSH_ECC=yes |
| 2840 | COMMENT_OUT_ECC="" |
| 2841 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2842 | unsupported_algorithms="$unsupported_algorithms \ |
| 2843 | ecdh-sha2-nistp521 \ |
| 2844 | ecdsa-sha2-nistp521 \ |
| 2845 | ecdsa-sha2-nistp521-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2846 | fi |
| 2847 | |
| 2848 | AC_SUBST([TEST_SSH_ECC]) |
| 2849 | AC_SUBST([COMMENT_OUT_ECC]) |
| 2850 | else |
| 2851 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
Damien Miller | 00797e8 | 2015-03-04 05:02:45 +1100 | [diff] [blame] | 2852 | AC_CHECK_FUNCS([crypt]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2853 | fi |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2854 | |
Damien Miller | 00f9cd2 | 2014-07-15 10:41:38 +1000 | [diff] [blame] | 2855 | AC_CHECK_FUNCS([ \ |
| 2856 | arc4random \ |
| 2857 | arc4random_buf \ |
| 2858 | arc4random_stir \ |
| 2859 | arc4random_uniform \ |
| 2860 | ]) |
| 2861 | |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2862 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2863 | AC_CHECK_LIB([iaf], [ia_openinfo], [ |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2864 | LIBS="$LIBS -liaf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2865 | AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf" |
| 2866 | AC_DEFINE([HAVE_LIBIAF], [1], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 2867 | [Define if system has libiaf that supports set_id]) |
Tim Rice | 0eeaf12 | 2007-09-10 16:24:17 -0700 | [diff] [blame] | 2868 | ]) |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2869 | ]) |
| 2870 | LIBS="$saved_LIBS" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2871 | |
| 2872 | ### Configure cryptographic random number support |
| 2873 | |
| 2874 | # Check wheter OpenSSL seeds itself |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2875 | if test "x$openssl" = "xyes" ; then |
| 2876 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
| 2877 | AC_RUN_IFELSE( |
| 2878 | [AC_LANG_PROGRAM([[ |
| 2879 | #include <string.h> |
| 2880 | #include <openssl/rand.h> |
| 2881 | ]], [[ |
| 2882 | exit(RAND_status() == 1 ? 0 : 1); |
| 2883 | ]])], |
| 2884 | [ |
| 2885 | OPENSSL_SEEDS_ITSELF=yes |
| 2886 | AC_MSG_RESULT([yes]) |
| 2887 | ], |
| 2888 | [ |
| 2889 | AC_MSG_RESULT([no]) |
| 2890 | ], |
| 2891 | [ |
| 2892 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 2893 | # This is safe, since we will fatal() at runtime if |
| 2894 | # OpenSSL is not seeded correctly. |
| 2895 | OPENSSL_SEEDS_ITSELF=yes |
| 2896 | ] |
| 2897 | ) |
| 2898 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2899 | |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 2900 | # PRNGD TCP socket |
| 2901 | AC_ARG_WITH([prngd-port], |
| 2902 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 2903 | [ |
| 2904 | case "$withval" in |
| 2905 | no) |
| 2906 | withval="" |
| 2907 | ;; |
| 2908 | [[0-9]]*) |
| 2909 | ;; |
| 2910 | *) |
| 2911 | AC_MSG_ERROR([You must specify a numeric port number for --with-prngd-port]) |
| 2912 | ;; |
| 2913 | esac |
| 2914 | if test ! -z "$withval" ; then |
| 2915 | PRNGD_PORT="$withval" |
| 2916 | AC_DEFINE_UNQUOTED([PRNGD_PORT], [$PRNGD_PORT], |
| 2917 | [Port number of PRNGD/EGD random number socket]) |
| 2918 | fi |
| 2919 | ] |
| 2920 | ) |
| 2921 | |
| 2922 | # PRNGD Unix domain socket |
| 2923 | AC_ARG_WITH([prngd-socket], |
| 2924 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 2925 | [ |
| 2926 | case "$withval" in |
| 2927 | yes) |
| 2928 | withval="/var/run/egd-pool" |
| 2929 | ;; |
| 2930 | no) |
| 2931 | withval="" |
| 2932 | ;; |
| 2933 | /*) |
| 2934 | ;; |
| 2935 | *) |
| 2936 | AC_MSG_ERROR([You must specify an absolute path to the entropy socket]) |
| 2937 | ;; |
| 2938 | esac |
| 2939 | |
| 2940 | if test ! -z "$withval" ; then |
| 2941 | if test ! -z "$PRNGD_PORT" ; then |
| 2942 | AC_MSG_ERROR([You may not specify both a PRNGD/EGD port and socket]) |
| 2943 | fi |
| 2944 | if test ! -r "$withval" ; then |
| 2945 | AC_MSG_WARN([Entropy socket is not readable]) |
| 2946 | fi |
| 2947 | PRNGD_SOCKET="$withval" |
| 2948 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"], |
| 2949 | [Location of PRNGD/EGD random number socket]) |
| 2950 | fi |
| 2951 | ], |
| 2952 | [ |
| 2953 | # Check for existing socket only if we don't have a random device already |
| 2954 | if test "x$OPENSSL_SEEDS_ITSELF" != "xyes" ; then |
| 2955 | AC_MSG_CHECKING([for PRNGD/EGD socket]) |
| 2956 | # Insert other locations here |
| 2957 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 2958 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 2959 | PRNGD_SOCKET="$sock" |
| 2960 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"]) |
| 2961 | break; |
| 2962 | fi |
| 2963 | done |
| 2964 | if test ! -z "$PRNGD_SOCKET" ; then |
| 2965 | AC_MSG_RESULT([$PRNGD_SOCKET]) |
| 2966 | else |
| 2967 | AC_MSG_RESULT([not found]) |
| 2968 | fi |
| 2969 | fi |
| 2970 | ] |
| 2971 | ) |
| 2972 | |
| 2973 | # Which randomness source do we use? |
| 2974 | if test ! -z "$PRNGD_PORT" ; then |
| 2975 | RAND_MSG="PRNGd port $PRNGD_PORT" |
| 2976 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 2977 | RAND_MSG="PRNGd socket $PRNGD_SOCKET" |
| 2978 | elif test ! -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 2979 | AC_DEFINE([OPENSSL_PRNG_ONLY], [1], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2980 | [Define if you want the OpenSSL internally seeded PRNG only]) |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 2981 | RAND_MSG="OpenSSL internal ONLY" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2982 | elif test "x$openssl" = "xno" ; then |
| 2983 | 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] | 2984 | else |
| 2985 | 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]) |
| 2986 | fi |
| 2987 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2988 | # Check for PAM libs |
| 2989 | PAM_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2990 | AC_ARG_WITH([pam], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2991 | [ --with-pam Enable PAM support ], |
| 2992 | [ |
| 2993 | if test "x$withval" != "xno" ; then |
| 2994 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ |
| 2995 | test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then |
| 2996 | AC_MSG_ERROR([PAM headers not found]) |
| 2997 | fi |
| 2998 | |
| 2999 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3000 | AC_CHECK_LIB([dl], [dlopen], , ) |
| 3001 | AC_CHECK_LIB([pam], [pam_set_item], , [AC_MSG_ERROR([*** libpam missing])]) |
| 3002 | AC_CHECK_FUNCS([pam_getenvlist]) |
| 3003 | AC_CHECK_FUNCS([pam_putenv]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3004 | LIBS="$saved_LIBS" |
| 3005 | |
| 3006 | PAM_MSG="yes" |
| 3007 | |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3008 | SSHDLIBS="$SSHDLIBS -lpam" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3009 | AC_DEFINE([USE_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3010 | [Define if you want to enable PAM support]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3011 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3012 | if test $ac_cv_lib_dl_dlopen = yes; then |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3013 | case "$LIBS" in |
| 3014 | *-ldl*) |
| 3015 | # libdl already in LIBS |
| 3016 | ;; |
| 3017 | *) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3018 | SSHDLIBS="$SSHDLIBS -ldl" |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3019 | ;; |
| 3020 | esac |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3021 | fi |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3022 | fi |
| 3023 | ] |
| 3024 | ) |
| 3025 | |
Damien Miller | 8bd81e1 | 2016-08-16 13:30:56 +1000 | [diff] [blame] | 3026 | AC_ARG_WITH([pam-service], |
| 3027 | [ --with-pam-service=name Specify PAM service name ], |
| 3028 | [ |
| 3029 | if test "x$withval" != "xno" && \ |
| 3030 | test "x$withval" != "xyes" ; then |
| 3031 | AC_DEFINE_UNQUOTED([SSHD_PAM_SERVICE], |
| 3032 | ["$withval"], [sshd PAM service name]) |
| 3033 | fi |
| 3034 | ] |
| 3035 | ) |
| 3036 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3037 | # Check for older PAM |
| 3038 | if test "x$PAM_MSG" = "xyes" ; then |
| 3039 | # Check PAM strerror arguments (old PAM) |
| 3040 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3041 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3042 | #include <stdlib.h> |
| 3043 | #if defined(HAVE_SECURITY_PAM_APPL_H) |
| 3044 | #include <security/pam_appl.h> |
| 3045 | #elif defined (HAVE_PAM_PAM_APPL_H) |
| 3046 | #include <pam/pam_appl.h> |
| 3047 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3048 | ]], [[ |
| 3049 | (void)pam_strerror((pam_handle_t *)NULL, -1); |
| 3050 | ]])], [AC_MSG_RESULT([no])], [ |
| 3051 | AC_DEFINE([HAVE_OLD_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3052 | [Define if you have an old version of PAM |
| 3053 | which takes only one argument to pam_strerror]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3054 | AC_MSG_RESULT([yes]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3055 | PAM_MSG="yes (old library)" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3056 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3057 | ]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3058 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3059 | |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 3060 | case "$host" in |
| 3061 | *-*-cygwin*) |
| 3062 | SSH_PRIVSEP_USER=CYGWIN_SSH_PRIVSEP_USER |
| 3063 | ;; |
| 3064 | *) |
| 3065 | SSH_PRIVSEP_USER=sshd |
| 3066 | ;; |
| 3067 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3068 | AC_ARG_WITH([privsep-user], |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 3069 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3070 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3071 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3072 | test "x${withval}" != "xyes"; then |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 3073 | SSH_PRIVSEP_USER=$withval |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3074 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3075 | ] |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3076 | ) |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 3077 | if test "x$SSH_PRIVSEP_USER" = "xCYGWIN_SSH_PRIVSEP_USER" ; then |
| 3078 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], [CYGWIN_SSH_PRIVSEP_USER], |
| 3079 | [Cygwin function to fetch non-privileged user for privilege separation]) |
| 3080 | else |
| 3081 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], ["$SSH_PRIVSEP_USER"], |
| 3082 | [non-privileged user for privilege separation]) |
| 3083 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3084 | AC_SUBST([SSH_PRIVSEP_USER]) |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3085 | |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3086 | if test "x$have_linux_no_new_privs" = "x1" ; then |
| 3087 | AC_CHECK_DECL([SECCOMP_MODE_FILTER], [have_seccomp_filter=1], , [ |
| 3088 | #include <sys/types.h> |
| 3089 | #include <linux/seccomp.h> |
| 3090 | ]) |
| 3091 | fi |
| 3092 | if test "x$have_seccomp_filter" = "x1" ; then |
| 3093 | AC_MSG_CHECKING([kernel for seccomp_filter support]) |
| 3094 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3095 | #include <errno.h> |
| 3096 | #include <elf.h> |
| 3097 | #include <linux/audit.h> |
| 3098 | #include <linux/seccomp.h> |
| 3099 | #include <stdlib.h> |
| 3100 | #include <sys/prctl.h> |
| 3101 | ]], |
| 3102 | [[ int i = $seccomp_audit_arch; |
| 3103 | errno = 0; |
| 3104 | prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0); |
| 3105 | exit(errno == EFAULT ? 0 : 1); ]])], |
| 3106 | [ AC_MSG_RESULT([yes]) ], [ |
| 3107 | AC_MSG_RESULT([no]) |
| 3108 | # Disable seccomp filter as a target |
| 3109 | have_seccomp_filter=0 |
| 3110 | ] |
| 3111 | ) |
| 3112 | fi |
| 3113 | |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3114 | # Decide which sandbox style to use |
| 3115 | sandbox_arg="" |
| 3116 | AC_ARG_WITH([sandbox], |
deraadt@openbsd.org | 2539dce | 2015-10-09 01:37:08 +0000 | [diff] [blame] | 3117 | [ --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] | 3118 | [ |
| 3119 | if test "x$withval" = "xyes" ; then |
| 3120 | sandbox_arg="" |
| 3121 | else |
| 3122 | sandbox_arg="$withval" |
| 3123 | fi |
| 3124 | ] |
| 3125 | ) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3126 | |
| 3127 | # Some platforms (seems to be the ones that have a kernel poll(2)-type |
| 3128 | # function with which they implement select(2)) use an extra file descriptor |
| 3129 | # when calling select(2), which means we can't use the rlimit sandbox. |
| 3130 | AC_MSG_CHECKING([if select works with descriptor rlimit]) |
| 3131 | AC_RUN_IFELSE( |
| 3132 | [AC_LANG_PROGRAM([[ |
| 3133 | #include <sys/types.h> |
| 3134 | #ifdef HAVE_SYS_TIME_H |
| 3135 | # include <sys/time.h> |
| 3136 | #endif |
| 3137 | #include <sys/resource.h> |
| 3138 | #ifdef HAVE_SYS_SELECT_H |
| 3139 | # include <sys/select.h> |
| 3140 | #endif |
| 3141 | #include <errno.h> |
| 3142 | #include <fcntl.h> |
| 3143 | #include <stdlib.h> |
| 3144 | ]],[[ |
| 3145 | struct rlimit rl_zero; |
| 3146 | int fd, r; |
| 3147 | fd_set fds; |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3148 | struct timeval tv; |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3149 | |
| 3150 | fd = open("/dev/null", O_RDONLY); |
| 3151 | FD_ZERO(&fds); |
| 3152 | FD_SET(fd, &fds); |
| 3153 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3154 | setrlimit(RLIMIT_FSIZE, &rl_zero); |
| 3155 | setrlimit(RLIMIT_NOFILE, &rl_zero); |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3156 | tv.tv_sec = 1; |
| 3157 | tv.tv_usec = 0; |
| 3158 | r = select(fd+1, &fds, NULL, NULL, &tv); |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3159 | exit (r == -1 ? 1 : 0); |
| 3160 | ]])], |
| 3161 | [AC_MSG_RESULT([yes]) |
| 3162 | select_works_with_rlimit=yes], |
| 3163 | [AC_MSG_RESULT([no]) |
| 3164 | select_works_with_rlimit=no], |
Mike Frysinger | dcc714c | 2017-05-24 23:21:19 -0400 | [diff] [blame^] | 3165 | [AC_MSG_WARN([cross compiling: assuming yes]) |
| 3166 | select_works_with_rlimit=yes] |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3167 | ) |
| 3168 | |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3169 | AC_MSG_CHECKING([if setrlimit(RLIMIT_NOFILE,{0,0}) works]) |
| 3170 | AC_RUN_IFELSE( |
| 3171 | [AC_LANG_PROGRAM([[ |
| 3172 | #include <sys/types.h> |
| 3173 | #ifdef HAVE_SYS_TIME_H |
| 3174 | # include <sys/time.h> |
| 3175 | #endif |
| 3176 | #include <sys/resource.h> |
| 3177 | #include <errno.h> |
| 3178 | #include <stdlib.h> |
| 3179 | ]],[[ |
| 3180 | struct rlimit rl_zero; |
| 3181 | int fd, r; |
| 3182 | fd_set fds; |
| 3183 | |
| 3184 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3185 | r = setrlimit(RLIMIT_NOFILE, &rl_zero); |
| 3186 | exit (r == -1 ? 1 : 0); |
| 3187 | ]])], |
| 3188 | [AC_MSG_RESULT([yes]) |
| 3189 | rlimit_nofile_zero_works=yes], |
| 3190 | [AC_MSG_RESULT([no]) |
| 3191 | rlimit_nofile_zero_works=no], |
Mike Frysinger | dcc714c | 2017-05-24 23:21:19 -0400 | [diff] [blame^] | 3192 | [AC_MSG_WARN([cross compiling: assuming yes]) |
| 3193 | rlimit_nofile_zero_works=yes] |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3194 | ) |
| 3195 | |
Darren Tucker | d545a4b | 2012-07-03 22:48:31 +1000 | [diff] [blame] | 3196 | AC_MSG_CHECKING([if setrlimit RLIMIT_FSIZE works]) |
| 3197 | AC_RUN_IFELSE( |
| 3198 | [AC_LANG_PROGRAM([[ |
| 3199 | #include <sys/types.h> |
| 3200 | #include <sys/resource.h> |
| 3201 | #include <stdlib.h> |
| 3202 | ]],[[ |
| 3203 | struct rlimit rl_zero; |
| 3204 | |
| 3205 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3206 | exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0); |
| 3207 | ]])], |
| 3208 | [AC_MSG_RESULT([yes])], |
| 3209 | [AC_MSG_RESULT([no]) |
| 3210 | AC_DEFINE(SANDBOX_SKIP_RLIMIT_FSIZE, 1, |
| 3211 | [setrlimit RLIMIT_FSIZE works])], |
| 3212 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 3213 | ) |
| 3214 | |
deraadt@openbsd.org | 2539dce | 2015-10-09 01:37:08 +0000 | [diff] [blame] | 3215 | if test "x$sandbox_arg" = "xpledge" || \ |
| 3216 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_pledge" = "xyes" ) ; then |
| 3217 | test "x$ac_cv_func_pledge" != "xyes" && \ |
| 3218 | AC_MSG_ERROR([pledge sandbox requires pledge(2) support]) |
| 3219 | SANDBOX_STYLE="pledge" |
Damien Miller | fafe1d8 | 2015-10-14 09:22:15 -0700 | [diff] [blame] | 3220 | AC_DEFINE([SANDBOX_PLEDGE], [1], [Sandbox using pledge(2)]) |
Damien Miller | 9846a2f | 2015-10-08 04:30:48 +1100 | [diff] [blame] | 3221 | elif test "x$sandbox_arg" = "xsystrace" || \ |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3222 | ( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3223 | test "x$have_systr_policy_kill" != "x1" && \ |
| 3224 | 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] | 3225 | SANDBOX_STYLE="systrace" |
| 3226 | AC_DEFINE([SANDBOX_SYSTRACE], [1], [Sandbox using systrace(4)]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 3227 | elif test "x$sandbox_arg" = "xdarwin" || \ |
| 3228 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \ |
| 3229 | test "x$ac_cv_header_sandbox_h" = "xyes") ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3230 | test "x$ac_cv_func_sandbox_init" != "xyes" -o \ |
| 3231 | "x$ac_cv_header_sandbox_h" != "xyes" && \ |
| 3232 | 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] | 3233 | SANDBOX_STYLE="darwin" |
| 3234 | AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3235 | elif test "x$sandbox_arg" = "xseccomp_filter" || \ |
| 3236 | ( test -z "$sandbox_arg" && \ |
Darren Tucker | d0494fd | 2012-05-19 14:25:39 +1000 | [diff] [blame] | 3237 | test "x$have_seccomp_filter" = "x1" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3238 | test "x$ac_cv_header_elf_h" = "xyes" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3239 | test "x$ac_cv_header_linux_audit_h" = "xyes" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3240 | test "x$ac_cv_header_linux_filter_h" = "xyes" && \ |
| 3241 | test "x$seccomp_audit_arch" != "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3242 | test "x$have_linux_no_new_privs" = "x1" && \ |
| 3243 | test "x$ac_cv_func_prctl" = "xyes" ) ; then |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3244 | test "x$seccomp_audit_arch" = "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3245 | AC_MSG_ERROR([seccomp_filter sandbox not supported on $host]) |
| 3246 | test "x$have_linux_no_new_privs" != "x1" && \ |
| 3247 | AC_MSG_ERROR([seccomp_filter sandbox requires PR_SET_NO_NEW_PRIVS]) |
| 3248 | test "x$have_seccomp_filter" != "x1" && \ |
| 3249 | AC_MSG_ERROR([seccomp_filter sandbox requires seccomp headers]) |
| 3250 | test "x$ac_cv_func_prctl" != "xyes" && \ |
| 3251 | AC_MSG_ERROR([seccomp_filter sandbox requires prctl function]) |
| 3252 | SANDBOX_STYLE="seccomp_filter" |
| 3253 | AC_DEFINE([SANDBOX_SECCOMP_FILTER], [1], [Sandbox using seccomp filter]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3254 | elif test "x$sandbox_arg" = "xcapsicum" || \ |
| 3255 | ( test -z "$sandbox_arg" && \ |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3256 | test "x$ac_cv_header_sys_capability_h" = "xyes" && \ |
| 3257 | test "x$ac_cv_func_cap_rights_limit" = "xyes") ; then |
| 3258 | test "x$ac_cv_header_sys_capability_h" != "xyes" && \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 3259 | AC_MSG_ERROR([capsicum sandbox requires sys/capability.h header]) |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3260 | test "x$ac_cv_func_cap_rights_limit" != "xyes" && \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 3261 | AC_MSG_ERROR([capsicum sandbox requires cap_rights_limit function]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3262 | SANDBOX_STYLE="capsicum" |
| 3263 | AC_DEFINE([SANDBOX_CAPSICUM], [1], [Sandbox using capsicum]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3264 | elif test "x$sandbox_arg" = "xrlimit" || \ |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3265 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" && \ |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3266 | test "x$select_works_with_rlimit" = "xyes" && \ |
| 3267 | test "x$rlimit_nofile_zero_works" = "xyes" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3268 | test "x$ac_cv_func_setrlimit" != "xyes" && \ |
| 3269 | AC_MSG_ERROR([rlimit sandbox requires setrlimit function]) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3270 | test "x$select_works_with_rlimit" != "xyes" && \ |
| 3271 | AC_MSG_ERROR([rlimit sandbox requires select to work with rlimit]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3272 | SANDBOX_STYLE="rlimit" |
| 3273 | AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 3274 | elif test "x$sandbox_arg" = "xsolaris" || \ |
| 3275 | ( test -z "$sandbox_arg" && test "x$SOLARIS_PRIVS" = "xyes" ) ; then |
| 3276 | SANDBOX_STYLE="solaris" |
| 3277 | AC_DEFINE([SANDBOX_SOLARIS], [1], [Sandbox using Solaris/Illumos privileges]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3278 | elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \ |
| 3279 | test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then |
| 3280 | SANDBOX_STYLE="none" |
| 3281 | AC_DEFINE([SANDBOX_NULL], [1], [no privsep sandboxing]) |
| 3282 | else |
Tim Rice | a6e6061 | 2011-08-17 21:48:22 -0700 | [diff] [blame] | 3283 | AC_MSG_ERROR([unsupported --with-sandbox]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3284 | fi |
| 3285 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 3286 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 3287 | if test ! -z "$SONY" ; then |
| 3288 | LIBS="$LIBS -liberty"; |
| 3289 | fi |
| 3290 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3291 | # Check for long long datatypes |
| 3292 | AC_CHECK_TYPES([long long, unsigned long long, long double]) |
| 3293 | |
| 3294 | # Check datatype sizes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3295 | AC_CHECK_SIZEOF([short int], [2]) |
| 3296 | AC_CHECK_SIZEOF([int], [4]) |
| 3297 | AC_CHECK_SIZEOF([long int], [4]) |
| 3298 | AC_CHECK_SIZEOF([long long int], [8]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3299 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 3300 | # Sanity check long long for some platforms (AIX) |
| 3301 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 3302 | ac_cv_sizeof_long_long_int=0 |
| 3303 | fi |
| 3304 | |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3305 | # compute LLONG_MIN and LLONG_MAX if we don't know them. |
| 3306 | if test -z "$have_llong_max"; then |
| 3307 | AC_MSG_CHECKING([for max value of long long]) |
| 3308 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3309 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3310 | #include <stdio.h> |
| 3311 | /* Why is this so damn hard? */ |
| 3312 | #ifdef __GNUC__ |
| 3313 | # undef __GNUC__ |
| 3314 | #endif |
| 3315 | #define __USE_ISOC99 |
| 3316 | #include <limits.h> |
| 3317 | #define DATA "conftest.llminmax" |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3318 | #define my_abs(a) ((a) < 0 ? ((a) * -1) : (a)) |
| 3319 | |
| 3320 | /* |
| 3321 | * printf in libc on some platforms (eg old Tru64) does not understand %lld so |
| 3322 | * we do this the hard way. |
| 3323 | */ |
| 3324 | static int |
| 3325 | fprint_ll(FILE *f, long long n) |
| 3326 | { |
| 3327 | unsigned int i; |
| 3328 | int l[sizeof(long long) * 8]; |
| 3329 | |
| 3330 | if (n < 0) |
| 3331 | if (fprintf(f, "-") < 0) |
| 3332 | return -1; |
| 3333 | for (i = 0; n != 0; i++) { |
| 3334 | l[i] = my_abs(n % 10); |
| 3335 | n /= 10; |
| 3336 | } |
| 3337 | do { |
| 3338 | if (fprintf(f, "%d", l[--i]) < 0) |
| 3339 | return -1; |
| 3340 | } while (i != 0); |
| 3341 | if (fprintf(f, " ") < 0) |
| 3342 | return -1; |
| 3343 | return 0; |
| 3344 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3345 | ]], [[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3346 | FILE *f; |
| 3347 | long long i, llmin, llmax = 0; |
| 3348 | |
| 3349 | if((f = fopen(DATA,"w")) == NULL) |
| 3350 | exit(1); |
| 3351 | |
| 3352 | #if defined(LLONG_MIN) && defined(LLONG_MAX) |
| 3353 | fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); |
| 3354 | llmin = LLONG_MIN; |
| 3355 | llmax = LLONG_MAX; |
| 3356 | #else |
| 3357 | fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); |
| 3358 | /* This will work on one's complement and two's complement */ |
| 3359 | for (i = 1; i > llmax; i <<= 1, i++) |
| 3360 | llmax = i; |
| 3361 | llmin = llmax + 1LL; /* wrap */ |
| 3362 | #endif |
| 3363 | |
| 3364 | /* Sanity check */ |
| 3365 | if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3366 | || llmax - 1 > llmax || llmin == llmax || llmin == 0 |
| 3367 | || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) { |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3368 | fprintf(f, "unknown unknown\n"); |
| 3369 | exit(2); |
| 3370 | } |
| 3371 | |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3372 | if (fprint_ll(f, llmin) < 0) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3373 | exit(3); |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3374 | if (fprint_ll(f, llmax) < 0) |
| 3375 | exit(4); |
| 3376 | if (fclose(f) < 0) |
| 3377 | exit(5); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3378 | exit(0); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3379 | ]])], |
| 3380 | [ |
| 3381 | llong_min=`$AWK '{print $1}' conftest.llminmax` |
| 3382 | llong_max=`$AWK '{print $2}' conftest.llminmax` |
| 3383 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3384 | AC_MSG_RESULT([$llong_max]) |
| 3385 | AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3386 | [max value of long long calculated by configure]) |
| 3387 | AC_MSG_CHECKING([for min value of long long]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3388 | AC_MSG_RESULT([$llong_min]) |
| 3389 | AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3390 | [min value of long long calculated by configure]) |
| 3391 | ], |
| 3392 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3393 | AC_MSG_RESULT([not found]) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3394 | ], |
| 3395 | [ |
| 3396 | AC_MSG_WARN([cross compiling: not checking]) |
| 3397 | ] |
| 3398 | ) |
| 3399 | fi |
| 3400 | |
| 3401 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3402 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3403 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3404 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3405 | [[ u_int a; a = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3406 | [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3407 | ]) |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3408 | ]) |
| 3409 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3410 | 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] | 3411 | have_u_int=1 |
| 3412 | fi |
| 3413 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3414 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3415 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3416 | [[ 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] | 3417 | [ ac_cv_have_intxx_t="yes" ], [ ac_cv_have_intxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3418 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3419 | ]) |
| 3420 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3421 | 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] | 3422 | have_intxx_t=1 |
| 3423 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3424 | |
| 3425 | if (test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3426 | test "x$ac_cv_header_stdint_h" = "xyes") |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3427 | then |
| 3428 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3429 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3430 | [[ 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] | 3431 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3432 | AC_DEFINE([HAVE_INTXX_T]) |
| 3433 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3434 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3435 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3436 | fi |
| 3437 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3438 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3439 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | 907881e | 2002-07-18 11:44:50 -0700 | [diff] [blame] | 3440 | #include <sys/types.h> |
| 3441 | #ifdef HAVE_STDINT_H |
| 3442 | # include <stdint.h> |
| 3443 | #endif |
| 3444 | #include <sys/socket.h> |
| 3445 | #ifdef HAVE_SYS_BITYPES_H |
| 3446 | # include <sys/bitypes.h> |
| 3447 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3448 | ]], [[ |
| 3449 | int64_t a; a = 1; |
| 3450 | ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3451 | [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3452 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3453 | ]) |
| 3454 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3455 | 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] | 3456 | fi |
| 3457 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3458 | 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] | 3459 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3460 | [[ 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] | 3461 | [ 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] | 3462 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3463 | ]) |
| 3464 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3465 | 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] | 3466 | have_u_intxx_t=1 |
| 3467 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3468 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3469 | if test -z "$have_u_intxx_t" ; then |
| 3470 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3471 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]], |
| 3472 | [[ 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] | 3473 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3474 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3475 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3476 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3477 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3478 | fi |
| 3479 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3480 | 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] | 3481 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3482 | [[ u_int64_t a; a = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3483 | [ 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] | 3484 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3485 | ]) |
| 3486 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3487 | 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] | 3488 | have_u_int64_t=1 |
| 3489 | fi |
| 3490 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3491 | if (test -z "$have_u_int64_t" && \ |
| 3492 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
| 3493 | then |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3494 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3495 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]], |
| 3496 | [[ u_int64_t a; a = 1]])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3497 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3498 | AC_DEFINE([HAVE_U_INT64_T]) |
| 3499 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3500 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3501 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3502 | fi |
| 3503 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3504 | if test -z "$have_u_intxx_t" ; then |
| 3505 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3506 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3507 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3508 | ]], [[ |
| 3509 | uint8_t a; |
| 3510 | uint16_t b; |
| 3511 | uint32_t c; |
| 3512 | a = b = c = 1; |
| 3513 | ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3514 | [ ac_cv_have_uintxx_t="yes" ], [ ac_cv_have_uintxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3515 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3516 | ]) |
| 3517 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3518 | AC_DEFINE([HAVE_UINTXX_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3519 | [define if you have uintxx_t data type]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3520 | fi |
| 3521 | fi |
| 3522 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3523 | if (test -z "$have_uintxx_t" && \ |
| 3524 | test "x$ac_cv_header_stdint_h" = "xyes") |
| 3525 | then |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3526 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3527 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3528 | [[ 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] | 3529 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3530 | AC_DEFINE([HAVE_UINTXX_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 | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3536 | if (test -z "$have_uintxx_t" && \ |
| 3537 | test "x$ac_cv_header_inttypes_h" = "xyes") |
| 3538 | then |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3539 | AC_MSG_CHECKING([for uintXX_t types in inttypes.h]) |
| 3540 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <inttypes.h> ]], |
| 3541 | [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;]])], |
| 3542 | [ |
| 3543 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3544 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3545 | ], [ AC_MSG_RESULT([no]) |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3546 | ]) |
| 3547 | fi |
| 3548 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 3549 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3550 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3551 | then |
| 3552 | 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] | 3553 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3554 | #include <sys/bitypes.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3555 | ]], [[ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 3556 | int8_t a; int16_t b; int32_t c; |
| 3557 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 3558 | a = b = c = e = f = g = 1; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3559 | ]])], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3560 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3561 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3562 | AC_DEFINE([HAVE_INTXX_T]) |
| 3563 | AC_MSG_RESULT([yes]) |
| 3564 | ], [AC_MSG_RESULT([no]) |
| 3565 | ]) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3566 | fi |
| 3567 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3568 | |
| 3569 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3570 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3571 | [[ u_char foo; foo = 125; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3572 | [ ac_cv_have_u_char="yes" ], [ ac_cv_have_u_char="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3573 | ]) |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3574 | ]) |
| 3575 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3576 | 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] | 3577 | fi |
| 3578 | |
Darren Tucker | 007e3b3 | 2013-11-03 18:43:55 +1100 | [diff] [blame] | 3579 | AC_CHECK_TYPES([intmax_t, uintmax_t], , , [ |
| 3580 | #include <sys/types.h> |
| 3581 | #include <stdint.h> |
| 3582 | ]) |
| 3583 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3584 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 3585 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3586 | AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>]) |
| 3587 | AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 3588 | #include <sys/types.h> |
| 3589 | #ifdef HAVE_SYS_BITYPES_H |
| 3590 | #include <sys/bitypes.h> |
| 3591 | #endif |
| 3592 | #ifdef HAVE_SYS_STATFS_H |
| 3593 | #include <sys/statfs.h> |
| 3594 | #endif |
| 3595 | #ifdef HAVE_SYS_STATVFS_H |
| 3596 | #include <sys/statvfs.h> |
| 3597 | #endif |
| 3598 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3599 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3600 | AC_CHECK_TYPES([in_addr_t, in_port_t], , , |
Damien Miller | 848b993 | 2005-02-24 12:12:34 +1100 | [diff] [blame] | 3601 | [#include <sys/types.h> |
| 3602 | #include <netinet/in.h>]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 3603 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3604 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3605 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3606 | [[ size_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3607 | [ ac_cv_have_size_t="yes" ], [ ac_cv_have_size_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3608 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3609 | ]) |
| 3610 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3611 | 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] | 3612 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 3613 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3614 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3615 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3616 | [[ ssize_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3617 | [ ac_cv_have_ssize_t="yes" ], [ ac_cv_have_ssize_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3618 | ]) |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3619 | ]) |
| 3620 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3621 | 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] | 3622 | fi |
| 3623 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3624 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3625 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <time.h> ]], |
| 3626 | [[ clock_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3627 | [ ac_cv_have_clock_t="yes" ], [ ac_cv_have_clock_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3628 | ]) |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3629 | ]) |
| 3630 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3631 | 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] | 3632 | fi |
| 3633 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3634 | 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] | 3635 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3636 | #include <sys/types.h> |
| 3637 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3638 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
| 3639 | [ ac_cv_have_sa_family_t="yes" ], |
| 3640 | [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3641 | #include <sys/types.h> |
| 3642 | #include <sys/socket.h> |
| 3643 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3644 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3645 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3646 | [ ac_cv_have_sa_family_t="no" ] |
| 3647 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3648 | ]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3649 | ]) |
| 3650 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3651 | AC_DEFINE([HAVE_SA_FAMILY_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3652 | [define if you have sa_family_t data type]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3653 | fi |
| 3654 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3655 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3656 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3657 | [[ pid_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3658 | [ ac_cv_have_pid_t="yes" ], [ ac_cv_have_pid_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3659 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3660 | ]) |
| 3661 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3662 | 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] | 3663 | fi |
| 3664 | |
| 3665 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3666 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3667 | [[ mode_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3668 | [ ac_cv_have_mode_t="yes" ], [ ac_cv_have_mode_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3669 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3670 | ]) |
| 3671 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3672 | 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] | 3673 | fi |
| 3674 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3675 | |
| 3676 | 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] | 3677 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3678 | #include <sys/types.h> |
| 3679 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3680 | ]], [[ struct sockaddr_storage s; ]])], |
| 3681 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3682 | [ ac_cv_have_struct_sockaddr_storage="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3683 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3684 | ]) |
| 3685 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3686 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3687 | [define if you have struct sockaddr_storage data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3688 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3689 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3690 | 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] | 3691 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3692 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3693 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3694 | ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])], |
| 3695 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3696 | [ ac_cv_have_struct_sockaddr_in6="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3697 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3698 | ]) |
| 3699 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3700 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_IN6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3701 | [define if you have struct sockaddr_in6 data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3702 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3703 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3704 | 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] | 3705 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3706 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3707 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3708 | ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])], |
| 3709 | [ ac_cv_have_struct_in6_addr="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3710 | [ ac_cv_have_struct_in6_addr="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3711 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3712 | ]) |
| 3713 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3714 | AC_DEFINE([HAVE_STRUCT_IN6_ADDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3715 | [define if you have struct in6_addr data type]) |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3716 | |
| 3717 | dnl Now check for sin6_scope_id |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3718 | AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , , |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3719 | [ |
| 3720 | #ifdef HAVE_SYS_TYPES_H |
| 3721 | #include <sys/types.h> |
| 3722 | #endif |
| 3723 | #include <netinet/in.h> |
| 3724 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3725 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3726 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3727 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3728 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3729 | #include <sys/types.h> |
| 3730 | #include <sys/socket.h> |
| 3731 | #include <netdb.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3732 | ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])], |
| 3733 | [ ac_cv_have_struct_addrinfo="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3734 | [ ac_cv_have_struct_addrinfo="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3735 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3736 | ]) |
| 3737 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3738 | AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3739 | [define if you have struct addrinfo data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3740 | fi |
| 3741 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3742 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3743 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], |
| 3744 | [[ struct timeval tv; tv.tv_sec = 1;]])], |
| 3745 | [ ac_cv_have_struct_timeval="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3746 | [ ac_cv_have_struct_timeval="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3747 | ]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3748 | ]) |
| 3749 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3750 | AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3751 | have_struct_timeval=1 |
| 3752 | fi |
| 3753 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3754 | AC_CHECK_TYPES([struct timespec]) |
Tim Rice | 4e4dc56 | 2003-03-18 10:21:40 -0800 | [diff] [blame] | 3755 | |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3756 | # 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] | 3757 | if test "x$ac_cv_have_int64_t" = "xno" && \ |
| 3758 | test "x$ac_cv_sizeof_long_int" != "x8" && \ |
| 3759 | test "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3760 | echo "OpenSSH requires int64_t support. Contact your vendor or install" |
| 3761 | echo "an alternative compiler (I.E., GCC) before continuing." |
| 3762 | echo "" |
| 3763 | exit 1; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3764 | else |
| 3765 | dnl test snprintf (broken on SCO w/gcc) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3766 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3767 | [AC_LANG_SOURCE([[ |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3768 | #include <stdio.h> |
| 3769 | #include <string.h> |
| 3770 | #ifdef HAVE_SNPRINTF |
| 3771 | main() |
| 3772 | { |
| 3773 | char buf[50]; |
| 3774 | char expected_out[50]; |
| 3775 | int mazsize = 50 ; |
| 3776 | #if (SIZEOF_LONG_INT == 8) |
| 3777 | long int num = 0x7fffffffffffffff; |
| 3778 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 3779 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3780 | #endif |
| 3781 | strcpy(expected_out, "9223372036854775807"); |
| 3782 | snprintf(buf, mazsize, "%lld", num); |
| 3783 | if(strcmp(buf, expected_out) != 0) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3784 | exit(1); |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3785 | exit(0); |
| 3786 | } |
| 3787 | #else |
| 3788 | main() { exit(0); } |
| 3789 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3790 | ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3791 | AC_MSG_WARN([cross compiling: Assuming working snprintf()]) |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3792 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 3793 | fi |
| 3794 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3795 | dnl Checks for structure members |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3796 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmp.h], [HAVE_HOST_IN_UTMP]) |
| 3797 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmpx.h], [HAVE_HOST_IN_UTMPX]) |
| 3798 | OSSH_CHECK_HEADER_FOR_FIELD([syslen], [utmpx.h], [HAVE_SYSLEN_IN_UTMPX]) |
| 3799 | OSSH_CHECK_HEADER_FOR_FIELD([ut_pid], [utmp.h], [HAVE_PID_IN_UTMP]) |
| 3800 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmp.h], [HAVE_TYPE_IN_UTMP]) |
| 3801 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmpx.h], [HAVE_TYPE_IN_UTMPX]) |
| 3802 | OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmp.h], [HAVE_TV_IN_UTMP]) |
| 3803 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmp.h], [HAVE_ID_IN_UTMP]) |
| 3804 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmpx.h], [HAVE_ID_IN_UTMPX]) |
| 3805 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP]) |
| 3806 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX]) |
| 3807 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP]) |
| 3808 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX]) |
| 3809 | OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP]) |
| 3810 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP]) |
| 3811 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX]) |
| 3812 | 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] | 3813 | |
| 3814 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3815 | AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, |
| 3816 | struct passwd.pw_change, struct passwd.pw_expire], |
| 3817 | [], [], [[ |
| 3818 | #include <sys/types.h> |
| 3819 | #include <pwd.h> |
| 3820 | ]]) |
| 3821 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3822 | AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state], |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3823 | [Define if we don't have struct __res_state in resolv.h])], |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3824 | [[ |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3825 | #include <stdio.h> |
| 3826 | #if HAVE_SYS_TYPES_H |
| 3827 | # include <sys/types.h> |
| 3828 | #endif |
| 3829 | #include <netinet/in.h> |
| 3830 | #include <arpa/nameser.h> |
| 3831 | #include <resolv.h> |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3832 | ]]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3833 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3834 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 3835 | ac_cv_have_ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3836 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3837 | #include <sys/types.h> |
| 3838 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3839 | ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])], |
| 3840 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 3841 | [ ac_cv_have_ss_family_in_struct_ss="no" ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3842 | ]) |
| 3843 | 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] | 3844 | 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] | 3845 | fi |
| 3846 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3847 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 3848 | ac_cv_have___ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3849 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3850 | #include <sys/types.h> |
| 3851 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3852 | ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])], |
| 3853 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3854 | [ ac_cv_have___ss_family_in_struct_ss="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3855 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3856 | ]) |
| 3857 | 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] | 3858 | AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3859 | [Fields in struct sockaddr_storage]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3860 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 3861 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3862 | 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] | 3863 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 3864 | ac_cv_have_accrights_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3865 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3866 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3867 | #include <sys/socket.h> |
| 3868 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3869 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3870 | #ifdef msg_accrights |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3871 | #error "msg_accrights is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3872 | exit(1); |
| 3873 | #endif |
| 3874 | struct msghdr m; |
| 3875 | m.msg_accrights = 0; |
| 3876 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3877 | ]])], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3878 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 3879 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 3880 | ) |
| 3881 | ]) |
| 3882 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3883 | AC_DEFINE([HAVE_ACCRIGHTS_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3884 | [Define if your system uses access rights style |
| 3885 | file descriptor passing]) |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3886 | fi |
| 3887 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3888 | AC_MSG_CHECKING([if struct statvfs.f_fsid is integral type]) |
| 3889 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e1a3ddf | 2012-05-04 11:05:45 +1000 | [diff] [blame] | 3890 | #include <sys/param.h> |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3891 | #include <sys/stat.h> |
| 3892 | #ifdef HAVE_SYS_TIME_H |
| 3893 | # include <sys/time.h> |
| 3894 | #endif |
| 3895 | #ifdef HAVE_SYS_MOUNT_H |
| 3896 | #include <sys/mount.h> |
| 3897 | #endif |
| 3898 | #ifdef HAVE_SYS_STATVFS_H |
| 3899 | #include <sys/statvfs.h> |
| 3900 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3901 | ]], [[ struct statvfs s; s.f_fsid = 0; ]])], |
| 3902 | [ AC_MSG_RESULT([yes]) ], |
| 3903 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3904 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3905 | AC_MSG_CHECKING([if fsid_t has member val]) |
| 3906 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3907 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3908 | #include <sys/statvfs.h> |
| 3909 | ]], [[ fsid_t t; t.val[0] = 0; ]])], |
| 3910 | [ AC_MSG_RESULT([yes]) |
| 3911 | AC_DEFINE([FSID_HAS_VAL], [1], [fsid_t has member val]) ], |
| 3912 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3913 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3914 | AC_MSG_CHECKING([if f_fsid has member __val]) |
| 3915 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3916 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3917 | #include <sys/statvfs.h> |
| 3918 | ]], [[ fsid_t t; t.__val[0] = 0; ]])], |
| 3919 | [ AC_MSG_RESULT([yes]) |
| 3920 | AC_DEFINE([FSID_HAS___VAL], [1], [fsid_t has member __val]) ], |
| 3921 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3922 | ]) |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 3923 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3924 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 3925 | ac_cv_have_control_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3926 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3927 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3928 | #include <sys/socket.h> |
| 3929 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3930 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3931 | #ifdef msg_control |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3932 | #error "msg_control is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3933 | exit(1); |
| 3934 | #endif |
| 3935 | struct msghdr m; |
| 3936 | m.msg_control = 0; |
| 3937 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3938 | ]])], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3939 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 3940 | [ ac_cv_have_control_in_msghdr="no" ] |
| 3941 | ) |
| 3942 | ]) |
| 3943 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3944 | AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3945 | [Define if your system uses ancillary data style |
| 3946 | file descriptor passing]) |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3947 | fi |
| 3948 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3949 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3950 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 3951 | [[ extern char *__progname; printf("%s", __progname); ]])], |
| 3952 | [ ac_cv_libc_defines___progname="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3953 | [ ac_cv_libc_defines___progname="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3954 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3955 | ]) |
| 3956 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3957 | AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3958 | fi |
| 3959 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3960 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3961 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 3962 | [[ printf("%s", __FUNCTION__); ]])], |
| 3963 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3964 | [ ac_cv_cc_implements___FUNCTION__="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3965 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3966 | ]) |
| 3967 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3968 | AC_DEFINE([HAVE___FUNCTION__], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3969 | [Define if compiler implements __FUNCTION__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3970 | fi |
| 3971 | |
| 3972 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3973 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 3974 | [[ printf("%s", __func__); ]])], |
| 3975 | [ ac_cv_cc_implements___func__="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3976 | [ ac_cv_cc_implements___func__="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3977 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3978 | ]) |
| 3979 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3980 | AC_DEFINE([HAVE___func__], [1], [Define if compiler implements __func__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3981 | fi |
| 3982 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3983 | AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3984 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3985 | #include <stdarg.h> |
| 3986 | va_list x,y; |
| 3987 | ]], [[ va_copy(x,y); ]])], |
| 3988 | [ ac_cv_have_va_copy="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3989 | [ ac_cv_have_va_copy="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3990 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3991 | ]) |
| 3992 | if test "x$ac_cv_have_va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3993 | AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3994 | fi |
| 3995 | |
| 3996 | AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3997 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3998 | #include <stdarg.h> |
| 3999 | va_list x,y; |
| 4000 | ]], [[ __va_copy(x,y); ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4001 | [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4002 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4003 | ]) |
| 4004 | if test "x$ac_cv_have___va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4005 | AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4006 | fi |
| 4007 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4008 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 4009 | ac_cv_have_getopt_optreset, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4010 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <getopt.h> ]], |
| 4011 | [[ extern int optreset; optreset = 0; ]])], |
| 4012 | [ ac_cv_have_getopt_optreset="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4013 | [ ac_cv_have_getopt_optreset="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4014 | ]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4015 | ]) |
| 4016 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4017 | AC_DEFINE([HAVE_GETOPT_OPTRESET], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4018 | [Define if your getopt(3) defines and uses optreset]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4019 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4020 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4021 | 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] | 4022 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4023 | [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])], |
| 4024 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4025 | [ ac_cv_libc_defines_sys_errlist="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4026 | ]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4027 | ]) |
| 4028 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4029 | AC_DEFINE([HAVE_SYS_ERRLIST], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4030 | [Define if your system defines sys_errlist[]]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4031 | fi |
| 4032 | |
| 4033 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 4034 | 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] | 4035 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4036 | [[ extern int sys_nerr; printf("%i", sys_nerr);]])], |
| 4037 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4038 | [ ac_cv_libc_defines_sys_nerr="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4039 | ]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 4040 | ]) |
| 4041 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4042 | 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] | 4043 | fi |
| 4044 | |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4045 | # Check libraries needed by DNS fingerprint support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4046 | AC_SEARCH_LIBS([getrrsetbyname], [resolv], |
| 4047 | [AC_DEFINE([HAVE_GETRRSETBYNAME], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4048 | [Define if getrrsetbyname() exists])], |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4049 | [ |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4050 | # Needed by our getrrsetbyname() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4051 | AC_SEARCH_LIBS([res_query], [resolv]) |
| 4052 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
| 4053 | AC_MSG_CHECKING([if res_query will link]) |
| 4054 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4055 | #include <sys/types.h> |
| 4056 | #include <netinet/in.h> |
| 4057 | #include <arpa/nameser.h> |
| 4058 | #include <netdb.h> |
| 4059 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4060 | ]], [[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4061 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4062 | ]])], |
| 4063 | AC_MSG_RESULT([yes]), |
| 4064 | [AC_MSG_RESULT([no]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4065 | saved_LIBS="$LIBS" |
| 4066 | LIBS="$LIBS -lresolv" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4067 | AC_MSG_CHECKING([for res_query in -lresolv]) |
| 4068 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4069 | #include <sys/types.h> |
| 4070 | #include <netinet/in.h> |
| 4071 | #include <arpa/nameser.h> |
| 4072 | #include <netdb.h> |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4073 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4074 | ]], [[ |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4075 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4076 | ]])], |
| 4077 | [AC_MSG_RESULT([yes])], |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4078 | [LIBS="$saved_LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4079 | AC_MSG_RESULT([no])]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4080 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4081 | AC_CHECK_FUNCS([_getshort _getlong]) |
Darren Tucker | d886e1c | 2005-06-01 18:57:45 +1000 | [diff] [blame] | 4082 | AC_CHECK_DECLS([_getshort, _getlong], , , |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 4083 | [#include <sys/types.h> |
| 4084 | #include <arpa/nameser.h>]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4085 | AC_CHECK_MEMBER([HEADER.ad], |
| 4086 | [AC_DEFINE([HAVE_HEADER_AD], [1], |
| 4087 | [Define if HEADER.ad exists in arpa/nameser.h])], , |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4088 | [#include <arpa/nameser.h>]) |
| 4089 | ]) |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4090 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4091 | AC_MSG_CHECKING([if struct __res_state _res is an extern]) |
| 4092 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4093 | #include <stdio.h> |
| 4094 | #if HAVE_SYS_TYPES_H |
| 4095 | # include <sys/types.h> |
| 4096 | #endif |
| 4097 | #include <netinet/in.h> |
| 4098 | #include <arpa/nameser.h> |
| 4099 | #include <resolv.h> |
| 4100 | extern struct __res_state _res; |
Darren Tucker | 7ad8b28 | 2015-09-11 13:11:02 +1000 | [diff] [blame] | 4101 | ]], [[ |
| 4102 | struct __res_state *volatile p = &_res; /* force resolution of _res */ |
| 4103 | return 0; |
| 4104 | ]],)], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4105 | [AC_MSG_RESULT([yes]) |
| 4106 | AC_DEFINE([HAVE__RES_EXTERN], [1], |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4107 | [Define if you have struct __res_state _res as an extern]) |
| 4108 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4109 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4110 | ) |
| 4111 | |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4112 | # Check whether user wants SELinux support |
| 4113 | SELINUX_MSG="no" |
| 4114 | LIBSELINUX="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4115 | AC_ARG_WITH([selinux], |
Damien Miller | 5b1c8b3 | 2008-03-27 12:33:07 +1100 | [diff] [blame] | 4116 | [ --with-selinux Enable SELinux support], |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4117 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4118 | save_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4119 | AC_DEFINE([WITH_SELINUX], [1], |
| 4120 | [Define if you want SELinux support.]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4121 | SELINUX_MSG="yes" |
| 4122 | AC_CHECK_HEADER([selinux/selinux.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4123 | AC_MSG_ERROR([SELinux support requires selinux.h header])) |
| 4124 | AC_CHECK_LIB([selinux], [setexeccon], |
Damien Miller | 1d2bfc4 | 2010-02-10 10:19:29 +1100 | [diff] [blame] | 4125 | [ LIBSELINUX="-lselinux" |
| 4126 | LIBS="$LIBS -lselinux" |
| 4127 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4128 | AC_MSG_ERROR([SELinux support requires libselinux library])) |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 4129 | SSHLIBS="$SSHLIBS $LIBSELINUX" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4130 | SSHDLIBS="$SSHDLIBS $LIBSELINUX" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4131 | AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level]) |
Darren Tucker | adc947d | 2006-10-07 09:07:20 +1000 | [diff] [blame] | 4132 | LIBS="$save_LIBS" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4133 | fi ] |
| 4134 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4135 | AC_SUBST([SSHLIBS]) |
| 4136 | AC_SUBST([SSHDLIBS]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4137 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4138 | # Check whether user wants Kerberos 5 support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4139 | KRB5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4140 | AC_ARG_WITH([kerberos5], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4141 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4142 | [ if test "x$withval" != "xno" ; then |
| 4143 | if test "x$withval" = "xyes" ; then |
| 4144 | KRB5ROOT="/usr/local" |
| 4145 | else |
| 4146 | KRB5ROOT=${withval} |
| 4147 | fi |
| 4148 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4149 | AC_DEFINE([KRB5], [1], [Define if you want Kerberos 5 support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4150 | KRB5_MSG="yes" |
| 4151 | |
Darren Tucker | 4089fc1 | 2016-12-08 12:57:24 +1100 | [diff] [blame] | 4152 | AC_PATH_TOOL([KRB5CONF], [krb5-config], |
Darren Tucker | dad48e7 | 2009-09-01 18:26:00 +1000 | [diff] [blame] | 4153 | [$KRB5ROOT/bin/krb5-config], |
| 4154 | [$KRB5ROOT/bin:$PATH]) |
| 4155 | if test -x $KRB5CONF ; then |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4156 | K5CFLAGS="`$KRB5CONF --cflags`" |
| 4157 | K5LIBS="`$KRB5CONF --libs`" |
| 4158 | CPPFLAGS="$CPPFLAGS $K5CFLAGS" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4159 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4160 | AC_MSG_CHECKING([for gssapi support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4161 | if $KRB5CONF | grep gssapi >/dev/null ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4162 | AC_MSG_RESULT([yes]) |
| 4163 | AC_DEFINE([GSSAPI], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4164 | [Define this if you want GSSAPI |
| 4165 | support in the version 2 protocol]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4166 | GSSCFLAGS="`$KRB5CONF --cflags gssapi`" |
| 4167 | GSSLIBS="`$KRB5CONF --libs gssapi`" |
| 4168 | CPPFLAGS="$CPPFLAGS $GSSCFLAGS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4169 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4170 | AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4171 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4172 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4173 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4174 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4175 | [ AC_MSG_RESULT([yes]) |
| 4176 | AC_DEFINE([HEIMDAL], [1], |
| 4177 | [Define this if you are using the Heimdal |
| 4178 | version of Kerberos V5]) ], |
| 4179 | [AC_MSG_RESULT([no]) |
| 4180 | ]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4181 | else |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4182 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4183 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4184 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4185 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4186 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4187 | [ AC_MSG_RESULT([yes]) |
| 4188 | AC_DEFINE([HEIMDAL]) |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4189 | K5LIBS="-lkrb5" |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4190 | K5LIBS="$K5LIBS -lcom_err -lasn1" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4191 | AC_CHECK_LIB([roken], [net_write], |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4192 | [K5LIBS="$K5LIBS -lroken"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4193 | AC_CHECK_LIB([des], [des_cbc_encrypt], |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4194 | [K5LIBS="$K5LIBS -ldes"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4195 | ], [ AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4196 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4197 | ]) |
| 4198 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4199 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4200 | AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context], |
| 4201 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4202 | GSSLIBS="-lgssapi_krb5" ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4203 | [ AC_CHECK_LIB([gssapi], [gss_init_sec_context], |
| 4204 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4205 | GSSLIBS="-lgssapi" ], |
Darren Tucker | a2b5a4c | 2013-02-22 10:43:15 +1100 | [diff] [blame] | 4206 | [ AC_CHECK_LIB([gss], [gss_init_sec_context], |
| 4207 | [ AC_DEFINE([GSSAPI]) |
| 4208 | GSSLIBS="-lgss" ], |
| 4209 | AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail])) |
| 4210 | ]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4211 | ]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4212 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4213 | AC_CHECK_HEADER([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4214 | [ unset ac_cv_header_gssapi_h |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4215 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4216 | AC_CHECK_HEADERS([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4217 | 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] | 4218 | ) |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4219 | ] |
| 4220 | ) |
| 4221 | |
| 4222 | oldCPP="$CPPFLAGS" |
| 4223 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4224 | AC_CHECK_HEADER([gssapi_krb5.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4225 | [ CPPFLAGS="$oldCPP" ]) |
| 4226 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4227 | fi |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4228 | if test ! -z "$need_dash_r" ; then |
| 4229 | LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" |
| 4230 | fi |
| 4231 | if test ! -z "$blibpath" ; then |
| 4232 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 4233 | fi |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4234 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4235 | AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h]) |
| 4236 | AC_CHECK_HEADERS([gssapi_krb5.h gssapi/gssapi_krb5.h]) |
| 4237 | AC_CHECK_HEADERS([gssapi_generic.h gssapi/gssapi_generic.h]) |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4238 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4239 | AC_SEARCH_LIBS([k_hasafs], [kafs], [AC_DEFINE([USE_AFS], [1], |
| 4240 | [Define this if you want to use libkafs' AFS support])]) |
Darren Tucker | 03978c6 | 2013-02-25 11:24:44 +1100 | [diff] [blame] | 4241 | |
| 4242 | AC_CHECK_DECLS([GSS_C_NT_HOSTBASED_SERVICE], [], [], [[ |
| 4243 | #ifdef HAVE_GSSAPI_H |
| 4244 | # include <gssapi.h> |
| 4245 | #elif defined(HAVE_GSSAPI_GSSAPI_H) |
| 4246 | # include <gssapi/gssapi.h> |
| 4247 | #endif |
| 4248 | |
| 4249 | #ifdef HAVE_GSSAPI_GENERIC_H |
| 4250 | # include <gssapi_generic.h> |
| 4251 | #elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H) |
| 4252 | # include <gssapi/gssapi_generic.h> |
| 4253 | #endif |
| 4254 | ]]) |
Darren Tucker | f3ab2c5 | 2013-08-04 21:48:41 +1000 | [diff] [blame] | 4255 | saved_LIBS="$LIBS" |
| 4256 | LIBS="$LIBS $K5LIBS" |
| 4257 | AC_CHECK_FUNCS([krb5_cc_new_unique krb5_get_error_message krb5_free_error_message]) |
| 4258 | LIBS="$saved_LIBS" |
| 4259 | |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4260 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4261 | ] |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4262 | ) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4263 | AC_SUBST([GSSLIBS]) |
| 4264 | AC_SUBST([K5LIBS]) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 4265 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4266 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4267 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4268 | PRIVSEP_PATH=/var/empty |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4269 | AC_ARG_WITH([privsep-path], |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 4270 | [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4271 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4272 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4273 | test "x${withval}" != "xyes"; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4274 | PRIVSEP_PATH=$withval |
| 4275 | fi |
| 4276 | ] |
| 4277 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4278 | AC_SUBST([PRIVSEP_PATH]) |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4279 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4280 | AC_ARG_WITH([xauth], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4281 | [ --with-xauth=PATH Specify path to xauth program ], |
| 4282 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4283 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4284 | test "x${withval}" != "xyes"; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4285 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4286 | fi |
| 4287 | ], |
| 4288 | [ |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4289 | TestPath="$PATH" |
| 4290 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" |
| 4291 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" |
| 4292 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" |
| 4293 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4294 | AC_PATH_PROG([xauth_path], [xauth], , [$TestPath]) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 4295 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4296 | xauth_path="/usr/openwin/bin/xauth" |
| 4297 | fi |
| 4298 | ] |
| 4299 | ) |
| 4300 | |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4301 | STRIP_OPT=-s |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4302 | AC_ARG_ENABLE([strip], |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4303 | [ --disable-strip Disable calling strip(1) on install], |
| 4304 | [ |
| 4305 | if test "x$enableval" = "xno" ; then |
| 4306 | STRIP_OPT= |
| 4307 | fi |
| 4308 | ] |
| 4309 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4310 | AC_SUBST([STRIP_OPT]) |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4311 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4312 | if test -z "$xauth_path" ; then |
| 4313 | XAUTH_PATH="undefined" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4314 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4315 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4316 | AC_DEFINE_UNQUOTED([XAUTH_PATH], ["$xauth_path"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4317 | [Define if xauth is found in your path]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4318 | XAUTH_PATH=$xauth_path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4319 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4320 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4321 | |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4322 | dnl # --with-maildir=/path/to/mail gets top priority. |
| 4323 | dnl # if maildir is set in the platform case statement above we use that. |
| 4324 | dnl # Otherwise we run a program to get the dir from system headers. |
| 4325 | dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL |
| 4326 | dnl # If we find _PATH_MAILDIR we do nothing because that is what |
| 4327 | dnl # session.c expects anyway. Otherwise we set to the value found |
| 4328 | dnl # stripping any trailing slash. If for some strage reason our program |
| 4329 | dnl # does not find what it needs, we default to /var/spool/mail. |
| 4330 | # Check for mail directory |
| 4331 | AC_ARG_WITH([maildir], |
| 4332 | [ --with-maildir=/path/to/mail Specify your system mail directory], |
| 4333 | [ |
| 4334 | if test "X$withval" != X && test "x$withval" != xno && \ |
| 4335 | test "x${withval}" != xyes; then |
| 4336 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"], |
| 4337 | [Set this to your mail directory if you do not have _PATH_MAILDIR]) |
| 4338 | fi |
| 4339 | ],[ |
| 4340 | if test "X$maildir" != "X"; then |
| 4341 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4342 | else |
| 4343 | AC_MSG_CHECKING([Discovering system mail directory]) |
| 4344 | AC_RUN_IFELSE( |
| 4345 | [AC_LANG_PROGRAM([[ |
| 4346 | #include <stdio.h> |
| 4347 | #include <string.h> |
| 4348 | #ifdef HAVE_PATHS_H |
| 4349 | #include <paths.h> |
| 4350 | #endif |
| 4351 | #ifdef HAVE_MAILLOCK_H |
| 4352 | #include <maillock.h> |
| 4353 | #endif |
| 4354 | #define DATA "conftest.maildir" |
| 4355 | ]], [[ |
| 4356 | FILE *fd; |
| 4357 | int rc; |
| 4358 | |
| 4359 | fd = fopen(DATA,"w"); |
| 4360 | if(fd == NULL) |
| 4361 | exit(1); |
| 4362 | |
| 4363 | #if defined (_PATH_MAILDIR) |
| 4364 | if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0) |
| 4365 | exit(1); |
| 4366 | #elif defined (MAILDIR) |
| 4367 | if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0) |
| 4368 | exit(1); |
| 4369 | #elif defined (_PATH_MAIL) |
| 4370 | if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0) |
| 4371 | exit(1); |
| 4372 | #else |
| 4373 | exit (2); |
| 4374 | #endif |
| 4375 | |
| 4376 | exit(0); |
| 4377 | ]])], |
| 4378 | [ |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4379 | maildir_what=`awk -F: '{print $1}' conftest.maildir` |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4380 | maildir=`awk -F: '{print $2}' conftest.maildir \ |
| 4381 | | sed 's|/$||'` |
| 4382 | AC_MSG_RESULT([Using: $maildir from $maildir_what]) |
| 4383 | if test "x$maildir_what" != "x_PATH_MAILDIR"; then |
| 4384 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4385 | fi |
| 4386 | ], |
| 4387 | [ |
| 4388 | if test "X$ac_status" = "X2";then |
| 4389 | # our test program didn't find it. Default to /var/spool/mail |
| 4390 | AC_MSG_RESULT([Using: default value of /var/spool/mail]) |
| 4391 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"]) |
| 4392 | else |
| 4393 | AC_MSG_RESULT([*** not found ***]) |
| 4394 | fi |
| 4395 | ], |
| 4396 | [ |
| 4397 | AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail]) |
| 4398 | ] |
| 4399 | ) |
| 4400 | fi |
| 4401 | ] |
| 4402 | ) # maildir |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4403 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4404 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4405 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) |
| 4406 | disable_ptmx_check=yes |
| 4407 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4408 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4409 | if test "x$disable_ptmx_check" != "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4410 | AC_CHECK_FILE(["/dev/ptmx"], |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4411 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4412 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTMX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4413 | [Define if you have /dev/ptmx]) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4414 | have_dev_ptmx=1 |
| 4415 | ] |
| 4416 | ) |
| 4417 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4418 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4419 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4420 | if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4421 | AC_CHECK_FILE(["/dev/ptc"], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4422 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4423 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTS_AND_PTC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4424 | [Define if you have /dev/ptc]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4425 | have_dev_ptc=1 |
| 4426 | ] |
| 4427 | ) |
| 4428 | else |
| 4429 | AC_MSG_WARN([cross compiling: Disabling /dev/ptc test]) |
| 4430 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 4431 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4432 | # Options from here on. Some of these are preset by platform above |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4433 | AC_ARG_WITH([mantype], |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4434 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4435 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4436 | case "$withval" in |
| 4437 | man|cat|doc) |
| 4438 | MANTYPE=$withval |
| 4439 | ;; |
| 4440 | *) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4441 | AC_MSG_ERROR([invalid man type: $withval]) |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4442 | ;; |
| 4443 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4444 | ] |
| 4445 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4446 | if test -z "$MANTYPE"; then |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4447 | TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4448 | AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4449 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4450 | MANTYPE=doc |
| 4451 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4452 | MANTYPE=man |
| 4453 | else |
| 4454 | MANTYPE=cat |
| 4455 | fi |
| 4456 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4457 | AC_SUBST([MANTYPE]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4458 | if test "$MANTYPE" = "doc"; then |
| 4459 | mansubdir=man; |
| 4460 | else |
| 4461 | mansubdir=$MANTYPE; |
| 4462 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4463 | AC_SUBST([mansubdir]) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4464 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4465 | # Check whether to enable MD5 passwords |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4466 | MD5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4467 | AC_ARG_WITH([md5-passwords], |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4468 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4469 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 4470 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4471 | AC_DEFINE([HAVE_MD5_PASSWORDS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4472 | [Define if you want to allow MD5 passwords]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4473 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4474 | fi |
| 4475 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4476 | ) |
| 4477 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4478 | # Whether to disable shadow password support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4479 | AC_ARG_WITH([shadow], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4480 | [ --without-shadow Disable shadow password support], |
| 4481 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4482 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4483 | AC_DEFINE([DISABLE_SHADOW]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4484 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4485 | fi |
| 4486 | ] |
| 4487 | ) |
| 4488 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4489 | if test -z "$disable_shadow" ; then |
| 4490 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4491 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4492 | #include <sys/types.h> |
| 4493 | #include <shadow.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4494 | struct spwd sp; |
| 4495 | ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])], |
| 4496 | [ sp_expire_available=yes ], [ |
| 4497 | ]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4498 | |
| 4499 | if test "x$sp_expire_available" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4500 | AC_MSG_RESULT([yes]) |
| 4501 | AC_DEFINE([HAS_SHADOW_EXPIRE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4502 | [Define if you want to use shadow password expire field]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4503 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4504 | AC_MSG_RESULT([no]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4505 | fi |
| 4506 | fi |
| 4507 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4508 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4509 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 4510 | DISPLAY_HACK_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4511 | AC_DEFINE([IPADDR_IN_DISPLAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4512 | [Define if you need to use IP address |
| 4513 | instead of hostname in $DISPLAY]) |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4514 | else |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4515 | DISPLAY_HACK_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4516 | AC_ARG_WITH([ipaddr-display], |
Tim Rice | 6397eed | 2015-06-03 21:41:11 -0700 | [diff] [blame] | 4517 | [ --with-ipaddr-display Use ip address instead of hostname in $DISPLAY], |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4518 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4519 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4520 | AC_DEFINE([IPADDR_IN_DISPLAY]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4521 | DISPLAY_HACK_MSG="yes" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4522 | fi |
| 4523 | ] |
| 4524 | ) |
| 4525 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4526 | |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4527 | # check for /etc/default/login and use it if present. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4528 | AC_ARG_ENABLE([etc-default-login], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 4529 | [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4530 | [ if test "x$enableval" = "xno"; then |
| 4531 | AC_MSG_NOTICE([/etc/default/login handling disabled]) |
| 4532 | etc_default_login=no |
| 4533 | else |
| 4534 | etc_default_login=yes |
| 4535 | fi ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4536 | [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; |
| 4537 | then |
| 4538 | AC_MSG_WARN([cross compiling: not checking /etc/default/login]) |
| 4539 | etc_default_login=no |
| 4540 | else |
| 4541 | etc_default_login=yes |
| 4542 | fi ] |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4543 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4544 | |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4545 | if test "x$etc_default_login" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4546 | AC_CHECK_FILE(["/etc/default/login"], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4547 | [ external_path_file=/etc/default/login ]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4548 | if test "x$external_path_file" = "x/etc/default/login"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4549 | AC_DEFINE([HAVE_ETC_DEFAULT_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4550 | [Define if your system has /etc/default/login]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4551 | fi |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4552 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4553 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4554 | 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] | 4555 | if test $ac_cv_func_login_getcapbool = "yes" && \ |
| 4556 | test $ac_cv_header_login_cap_h = "yes" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4557 | external_path_file=/etc/login.conf |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4558 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4559 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4560 | # Whether to mess with the default path |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4561 | SERVER_PATH_MSG="(default)" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4562 | AC_ARG_WITH([default-path], |
Tim Rice | 6397eed | 2015-06-03 21:41:11 -0700 | [diff] [blame] | 4563 | [ --with-default-path= Specify default $PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4564 | [ |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4565 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4566 | AC_MSG_WARN([ |
| 4567 | --with-default-path=PATH has no effect on this system. |
| 4568 | Edit /etc/login.conf instead.]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4569 | elif test "x$withval" != "xno" ; then |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4570 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4571 | AC_MSG_WARN([ |
| 4572 | --with-default-path=PATH will only be used if PATH is not defined in |
| 4573 | $external_path_file .]) |
| 4574 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4575 | user_path="$withval" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4576 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4577 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4578 | ], |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4579 | [ if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 4580 | 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] | 4581 | else |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4582 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4583 | AC_MSG_WARN([ |
| 4584 | If PATH is defined in $external_path_file, ensure the path to scp is included, |
| 4585 | otherwise scp will not work.]) |
| 4586 | fi |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4587 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4588 | [AC_LANG_PROGRAM([[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4589 | /* find out what STDPATH is */ |
| 4590 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4591 | #ifdef HAVE_PATHS_H |
| 4592 | # include <paths.h> |
| 4593 | #endif |
| 4594 | #ifndef _PATH_STDPATH |
Tim Rice | 1c9e688 | 2002-11-22 13:29:01 -0800 | [diff] [blame] | 4595 | # ifdef _PATH_USERPATH /* Irix */ |
| 4596 | # define _PATH_STDPATH _PATH_USERPATH |
| 4597 | # else |
| 4598 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 4599 | # endif |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4600 | #endif |
| 4601 | #include <sys/types.h> |
| 4602 | #include <sys/stat.h> |
| 4603 | #include <fcntl.h> |
| 4604 | #define DATA "conftest.stdpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4605 | ]], [[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4606 | FILE *fd; |
| 4607 | int rc; |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4608 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4609 | fd = fopen(DATA,"w"); |
| 4610 | if(fd == NULL) |
| 4611 | exit(1); |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4612 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4613 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 4614 | exit(1); |
| 4615 | |
| 4616 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4617 | ]])], |
| 4618 | [ user_path=`cat conftest.stdpath` ], |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4619 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 4620 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 4621 | ) |
| 4622 | # make sure $bindir is in USER_PATH so scp will work |
Damien Miller | 77eab7b | 2012-07-06 11:49:28 +1000 | [diff] [blame] | 4623 | t_bindir="${bindir}" |
| 4624 | while echo "${t_bindir}" | egrep '\$\{|NONE/' >/dev/null 2>&1; do |
| 4625 | t_bindir=`eval echo ${t_bindir}` |
| 4626 | case $t_bindir in |
| 4627 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 4628 | esac |
| 4629 | case $t_bindir in |
| 4630 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 4631 | esac |
| 4632 | done |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4633 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 4634 | if test $? -ne 0 ; then |
| 4635 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 4636 | if test $? -ne 0 ; then |
| 4637 | user_path=$user_path:$t_bindir |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4638 | 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] | 4639 | fi |
| 4640 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4641 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4642 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4643 | if test "x$external_path_file" != "x/etc/login.conf" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4644 | AC_DEFINE_UNQUOTED([USER_PATH], ["$user_path"], [Specify default $PATH]) |
| 4645 | AC_SUBST([user_path]) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4646 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4647 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4648 | # Set superuser path separately to user path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4649 | AC_ARG_WITH([superuser-path], |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4650 | [ --with-superuser-path= Specify different path for super-user], |
| 4651 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4652 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4653 | test "x${withval}" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4654 | AC_DEFINE_UNQUOTED([SUPERUSER_PATH], ["$withval"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4655 | [Define if you want a different $PATH |
| 4656 | for the superuser]) |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4657 | superuser_path=$withval |
| 4658 | fi |
| 4659 | ] |
| 4660 | ) |
| 4661 | |
| 4662 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4663 | 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] | 4664 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4665 | AC_ARG_WITH(4in6, |
| 4666 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 4667 | [ |
| 4668 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4669 | AC_MSG_RESULT([yes]) |
| 4670 | AC_DEFINE([IPV4_IN_IPV6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4671 | [Detect IPv4 in IPv6 mapped addresses |
| 4672 | and treat as IPv4]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4673 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4674 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4675 | AC_MSG_RESULT([no]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4676 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4677 | ], [ |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4678 | if test "x$inet6_default_4in6" = "xyes"; then |
| 4679 | AC_MSG_RESULT([yes (default)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4680 | AC_DEFINE([IPV4_IN_IPV6]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4681 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4682 | else |
| 4683 | AC_MSG_RESULT([no (default)]) |
| 4684 | fi |
| 4685 | ] |
| 4686 | ) |
| 4687 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4688 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4689 | BSD_AUTH_MSG=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4690 | AC_ARG_WITH([bsd-auth], |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4691 | [ --with-bsd-auth Enable BSD auth support], |
| 4692 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4693 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4694 | AC_DEFINE([BSD_AUTH], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4695 | [Define if you have BSD auth support]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4696 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4697 | fi |
| 4698 | ] |
| 4699 | ) |
| 4700 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4701 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 4702 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4703 | # make sure the directory exists |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4704 | if test ! -d $piddir ; then |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4705 | piddir=`eval echo ${sysconfdir}` |
| 4706 | case $piddir in |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4707 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4708 | esac |
| 4709 | fi |
| 4710 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4711 | AC_ARG_WITH([pid-dir], |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4712 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 4713 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4714 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4715 | test "x${withval}" != "xyes"; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4716 | piddir=$withval |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4717 | if test ! -d $piddir ; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4718 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 4719 | fi |
| 4720 | fi |
| 4721 | ] |
| 4722 | ) |
| 4723 | |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4724 | AC_DEFINE_UNQUOTED([_PATH_SSH_PIDDIR], ["$piddir"], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4725 | [Specify location of ssh.pid]) |
| 4726 | AC_SUBST([piddir]) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 4727 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4728 | dnl allow user to disable some login recording features |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4729 | AC_ARG_ENABLE([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4730 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4731 | [ |
| 4732 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4733 | AC_DEFINE([DISABLE_LASTLOG]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4734 | fi |
| 4735 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4736 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4737 | AC_ARG_ENABLE([utmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4738 | [ --disable-utmp disable use of utmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4739 | [ |
| 4740 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4741 | AC_DEFINE([DISABLE_UTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4742 | fi |
| 4743 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4744 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4745 | AC_ARG_ENABLE([utmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4746 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4747 | [ |
| 4748 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4749 | AC_DEFINE([DISABLE_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4750 | [Define if you don't want to use utmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4751 | fi |
| 4752 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4753 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4754 | AC_ARG_ENABLE([wtmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4755 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4756 | [ |
| 4757 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4758 | AC_DEFINE([DISABLE_WTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4759 | fi |
| 4760 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4761 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4762 | AC_ARG_ENABLE([wtmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4763 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4764 | [ |
| 4765 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4766 | AC_DEFINE([DISABLE_WTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4767 | [Define if you don't want to use wtmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4768 | fi |
| 4769 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4770 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4771 | AC_ARG_ENABLE([libutil], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4772 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4773 | [ |
| 4774 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4775 | AC_DEFINE([DISABLE_LOGIN]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4776 | fi |
| 4777 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4778 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4779 | AC_ARG_ENABLE([pututline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4780 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4781 | [ |
| 4782 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4783 | AC_DEFINE([DISABLE_PUTUTLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4784 | [Define if you don't want to use pututline() |
| 4785 | etc. to write [uw]tmp]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4786 | fi |
| 4787 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4788 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4789 | AC_ARG_ENABLE([pututxline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4790 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4791 | [ |
| 4792 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4793 | AC_DEFINE([DISABLE_PUTUTXLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4794 | [Define if you don't want to use pututxline() |
| 4795 | etc. to write [uw]tmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4796 | fi |
| 4797 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4798 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4799 | AC_ARG_WITH([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4800 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4801 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4802 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4803 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4804 | elif test -n "$withval" && test "x${withval}" != "xyes"; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4805 | conf_lastlog_location=$withval |
| 4806 | fi |
| 4807 | ] |
| 4808 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4809 | |
| 4810 | dnl lastlog, [uw]tmpx? detection |
| 4811 | dnl NOTE: set the paths in the platform section to avoid the |
| 4812 | dnl need for command-line parameters |
| 4813 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 4814 | |
| 4815 | dnl lastlog detection |
| 4816 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 4817 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4818 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4819 | #include <sys/types.h> |
| 4820 | #include <utmp.h> |
| 4821 | #ifdef HAVE_LASTLOG_H |
| 4822 | # include <lastlog.h> |
| 4823 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4824 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4825 | # include <paths.h> |
| 4826 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 4827 | #ifdef HAVE_LOGIN_H |
| 4828 | # include <login.h> |
| 4829 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4830 | ]], [[ char *lastlog = LASTLOG_FILE; ]])], |
| 4831 | [ AC_MSG_RESULT([yes]) ], |
| 4832 | [ |
| 4833 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4834 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4835 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4836 | #include <sys/types.h> |
| 4837 | #include <utmp.h> |
| 4838 | #ifdef HAVE_LASTLOG_H |
| 4839 | # include <lastlog.h> |
| 4840 | #endif |
| 4841 | #ifdef HAVE_PATHS_H |
| 4842 | # include <paths.h> |
| 4843 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4844 | ]], [[ char *lastlog = _PATH_LASTLOG; ]])], |
| 4845 | [ AC_MSG_RESULT([yes]) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4846 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4847 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4848 | system_lastlog_path=no |
| 4849 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4850 | ]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4851 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4852 | if test -z "$conf_lastlog_location"; then |
| 4853 | if test x"$system_lastlog_path" = x"no" ; then |
| 4854 | 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] | 4855 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4856 | conf_lastlog_location=$f |
| 4857 | fi |
| 4858 | done |
| 4859 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 4860 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 4861 | 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] | 4862 | fi |
| 4863 | fi |
| 4864 | fi |
| 4865 | |
| 4866 | if test -n "$conf_lastlog_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4867 | AC_DEFINE_UNQUOTED([CONF_LASTLOG_FILE], ["$conf_lastlog_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4868 | [Define if you want to specify the path to your lastlog file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4869 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4870 | |
| 4871 | dnl utmp detection |
| 4872 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4873 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4874 | #include <sys/types.h> |
| 4875 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4876 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4877 | # include <paths.h> |
| 4878 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4879 | ]], [[ char *utmp = UTMP_FILE; ]])], |
| 4880 | [ AC_MSG_RESULT([yes]) ], |
| 4881 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4882 | system_utmp_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4883 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4884 | if test -z "$conf_utmp_location"; then |
| 4885 | if test x"$system_utmp_path" = x"no" ; then |
| 4886 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 4887 | if test -f $f ; then |
| 4888 | conf_utmp_location=$f |
| 4889 | fi |
| 4890 | done |
| 4891 | if test -z "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4892 | AC_DEFINE([DISABLE_UTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4893 | fi |
| 4894 | fi |
| 4895 | fi |
| 4896 | if test -n "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4897 | AC_DEFINE_UNQUOTED([CONF_UTMP_FILE], ["$conf_utmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4898 | [Define if you want to specify the path to your utmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4899 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4900 | |
| 4901 | dnl wtmp detection |
| 4902 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4903 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4904 | #include <sys/types.h> |
| 4905 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4906 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4907 | # include <paths.h> |
| 4908 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4909 | ]], [[ char *wtmp = WTMP_FILE; ]])], |
| 4910 | [ AC_MSG_RESULT([yes]) ], |
| 4911 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4912 | system_wtmp_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4913 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4914 | if test -z "$conf_wtmp_location"; then |
| 4915 | if test x"$system_wtmp_path" = x"no" ; then |
| 4916 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 4917 | if test -f $f ; then |
| 4918 | conf_wtmp_location=$f |
| 4919 | fi |
| 4920 | done |
| 4921 | if test -z "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4922 | AC_DEFINE([DISABLE_WTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4923 | fi |
| 4924 | fi |
| 4925 | fi |
| 4926 | if test -n "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4927 | AC_DEFINE_UNQUOTED([CONF_WTMP_FILE], ["$conf_wtmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4928 | [Define if you want to specify the path to your wtmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4929 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4930 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4931 | dnl wtmpx detection |
| 4932 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4933 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4934 | #include <sys/types.h> |
| 4935 | #include <utmp.h> |
| 4936 | #ifdef HAVE_UTMPX_H |
| 4937 | #include <utmpx.h> |
| 4938 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4939 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4940 | # include <paths.h> |
| 4941 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4942 | ]], [[ char *wtmpx = WTMPX_FILE; ]])], |
| 4943 | [ AC_MSG_RESULT([yes]) ], |
| 4944 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4945 | system_wtmpx_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4946 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4947 | if test -z "$conf_wtmpx_location"; then |
| 4948 | if test x"$system_wtmpx_path" = x"no" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4949 | AC_DEFINE([DISABLE_WTMPX]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4950 | fi |
| 4951 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4952 | AC_DEFINE_UNQUOTED([CONF_WTMPX_FILE], ["$conf_wtmpx_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4953 | [Define if you want to specify the path to your wtmpx file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4954 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4955 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 4956 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 4957 | if test ! -z "$blibpath" ; then |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 4958 | LDFLAGS="$LDFLAGS $blibflags$blibpath" |
| 4959 | AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 4960 | fi |
| 4961 | |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4962 | AC_CHECK_MEMBER([struct lastlog.ll_line], [], [ |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 4963 | if test x$SKIP_DISABLE_LASTLOG_DEFINE != "xyes" ; then |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4964 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 4965 | fi |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4966 | ], [ |
| 4967 | #ifdef HAVE_SYS_TYPES_H |
| 4968 | #include <sys/types.h> |
| 4969 | #endif |
| 4970 | #ifdef HAVE_UTMP_H |
| 4971 | #include <utmp.h> |
| 4972 | #endif |
| 4973 | #ifdef HAVE_UTMPX_H |
| 4974 | #include <utmpx.h> |
| 4975 | #endif |
| 4976 | #ifdef HAVE_LASTLOG_H |
| 4977 | #include <lastlog.h> |
| 4978 | #endif |
| 4979 | ]) |
| 4980 | |
| 4981 | AC_CHECK_MEMBER([struct utmp.ut_line], [], [ |
| 4982 | AC_DEFINE([DISABLE_UTMP]) |
| 4983 | AC_DEFINE([DISABLE_WTMP]) |
| 4984 | ], [ |
| 4985 | #ifdef HAVE_SYS_TYPES_H |
| 4986 | #include <sys/types.h> |
| 4987 | #endif |
| 4988 | #ifdef HAVE_UTMP_H |
| 4989 | #include <utmp.h> |
| 4990 | #endif |
| 4991 | #ifdef HAVE_UTMPX_H |
| 4992 | #include <utmpx.h> |
| 4993 | #endif |
| 4994 | #ifdef HAVE_LASTLOG_H |
| 4995 | #include <lastlog.h> |
| 4996 | #endif |
| 4997 | ]) |
| 4998 | |
Darren Tucker | 7da23cb | 2005-08-03 00:20:15 +1000 | [diff] [blame] | 4999 | dnl Adding -Werror to CFLAGS early prevents configure tests from running. |
| 5000 | dnl Add now. |
| 5001 | CFLAGS="$CFLAGS $werror_flags" |
| 5002 | |
Darren Tucker | 627337d | 2010-04-10 22:58:01 +1000 | [diff] [blame] | 5003 | if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then |
| 5004 | TEST_SSH_IPV6=no |
| 5005 | else |
| 5006 | TEST_SSH_IPV6=yes |
| 5007 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5008 | AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no]) |
| 5009 | AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6]) |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 5010 | AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 5011 | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) |
Darren Tucker | 6d8bd57 | 2013-06-11 11:26:10 +1000 | [diff] [blame] | 5012 | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) |
Darren Tucker | 5d37690 | 2008-06-11 04:15:05 +1000 | [diff] [blame] | 5013 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 5014 | AC_EXEEXT |
Damien Miller | 223897a | 2006-09-12 21:54:10 +1000 | [diff] [blame] | 5015 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
| 5016 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 5017 | survey.sh]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 5018 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 5019 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5020 | # Print summary of options |
| 5021 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5022 | # Someone please show me a better way :) |
| 5023 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 5024 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 5025 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 5026 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 5027 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 5028 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5029 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5030 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 5031 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 5032 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5033 | |
| 5034 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 5035 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5036 | echo " User binaries: $B" |
| 5037 | echo " System binaries: $C" |
| 5038 | echo " Configuration files: $D" |
| 5039 | echo " Askpass program: $E" |
| 5040 | echo " Manual pages: $F" |
| 5041 | echo " PID file: $G" |
| 5042 | echo " Privilege separation chroot path: $H" |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 5043 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 5044 | echo " At runtime, sshd will use the path defined in $external_path_file" |
| 5045 | 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] | 5046 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5047 | echo " sshd default user PATH: $I" |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 5048 | if test ! -z "$external_path_file"; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 5049 | echo " (If PATH is set in $external_path_file it will be used instead. If" |
| 5050 | echo " used, ensure the path to scp is present, otherwise scp will not work.)" |
| 5051 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 5052 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 5053 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5054 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 5055 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5056 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 5057 | echo " PAM support: $PAM_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 5058 | echo " OSF SIA support: $SIA_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5059 | echo " KerberosV support: $KRB5_MSG" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 5060 | echo " SELinux support: $SELINUX_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5061 | echo " Smartcard support: $SCARD_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5062 | echo " S/KEY support: $SKEY_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5063 | echo " MD5 password support: $MD5_MSG" |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 5064 | echo " libedit support: $LIBEDIT_MSG" |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 5065 | echo " libldns support: $LDNS_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 5066 | echo " Solaris process contract support: $SPC_MSG" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 5067 | echo " Solaris project support: $SP_MSG" |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 5068 | echo " Solaris privilege support: $SPP_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 5069 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5070 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 5071 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 5072 | echo " Random number source: $RAND_MSG" |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 5073 | echo " Privsep sandbox style: $SANDBOX_STYLE" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 5074 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5075 | echo "" |
| 5076 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 5077 | echo " Host: ${host}" |
| 5078 | echo " Compiler: ${CC}" |
| 5079 | echo " Compiler flags: ${CFLAGS}" |
| 5080 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 5081 | echo " Linker flags: ${LDFLAGS}" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 5082 | echo " Libraries: ${LIBS}" |
| 5083 | if test ! -z "${SSHDLIBS}"; then |
| 5084 | echo " +for sshd: ${SSHDLIBS}" |
| 5085 | fi |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 5086 | if test ! -z "${SSHLIBS}"; then |
| 5087 | echo " +for ssh: ${SSHLIBS}" |
| 5088 | fi |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5089 | |
| 5090 | echo "" |
| 5091 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 5092 | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then |
Darren Tucker | cf59d31 | 2004-08-29 21:18:09 +1000 | [diff] [blame] | 5093 | echo "SVR4 style packages are supported with \"make package\"" |
| 5094 | echo "" |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 5095 | fi |
| 5096 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 5097 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 5098 | echo "PAM is enabled. You may need to install a PAM control file " |
| 5099 | echo "for sshd, otherwise password authentication may fail. " |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 5100 | echo "Example PAM control files can be found in the contrib/ " |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 5101 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 5102 | echo "" |
| 5103 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 5104 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 5105 | if test ! -z "$NO_PEERCHECK" ; then |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 5106 | echo "WARNING: the operating system that you are using does not" |
| 5107 | echo "appear to support getpeereid(), getpeerucred() or the" |
| 5108 | echo "SO_PEERCRED getsockopt() option. These facilities are used to" |
| 5109 | echo "enforce security checks to prevent unauthorised connections to" |
| 5110 | echo "ssh-agent. Their absence increases the risk that a malicious" |
| 5111 | echo "user can connect to your agent." |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 5112 | echo "" |
| 5113 | fi |
| 5114 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 5115 | if test "$AUDIT_MODULE" = "bsm" ; then |
| 5116 | echo "WARNING: BSM audit support is currently considered EXPERIMENTAL." |
| 5117 | echo "See the Solaris section in README.platform for details." |
| 5118 | fi |