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 | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 166 | if test "x$use_toolchain_hardening" = "x1"; then |
Damien Miller | 161af8f | 2017-09-19 10:18:56 +1000 | [diff] [blame] | 167 | OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) |
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 | ) |
Damien Miller | de35c38 | 2017-09-08 12:38:31 +1000 | [diff] [blame] | 292 | |
| 293 | AC_ARG_WITH([cflags-after], |
| 294 | [ --with-cflags-after Specify additional flags to pass to compiler after configure], |
| 295 | [ |
| 296 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 297 | test "x${withval}" != "xyes"; then |
| 298 | CFLAGS_AFTER="$withval" |
| 299 | fi |
| 300 | ] |
| 301 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 302 | AC_ARG_WITH([cppflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 303 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 304 | [ |
| 305 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 306 | test "x${withval}" != "xyes"; then |
| 307 | CPPFLAGS="$CPPFLAGS $withval" |
| 308 | fi |
| 309 | ] |
| 310 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 311 | AC_ARG_WITH([ldflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 312 | [ --with-ldflags Specify additional flags to pass to linker], |
| 313 | [ |
| 314 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 315 | test "x${withval}" != "xyes"; then |
| 316 | LDFLAGS="$LDFLAGS $withval" |
| 317 | fi |
| 318 | ] |
| 319 | ) |
Damien Miller | de35c38 | 2017-09-08 12:38:31 +1000 | [diff] [blame] | 320 | AC_ARG_WITH([ldflags-after], |
| 321 | [ --with-ldflags-after Specify additional flags to pass to linker after configure], |
| 322 | [ |
| 323 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 324 | test "x${withval}" != "xyes"; then |
| 325 | LDFLAGS_AFTER="$withval" |
| 326 | fi |
| 327 | ] |
| 328 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 329 | AC_ARG_WITH([libs], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 330 | [ --with-libs Specify additional libraries to link with], |
| 331 | [ |
| 332 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 333 | test "x${withval}" != "xyes"; then |
| 334 | LIBS="$LIBS $withval" |
| 335 | fi |
| 336 | ] |
| 337 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 338 | AC_ARG_WITH([Werror], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 339 | [ --with-Werror Build main code with -Werror], |
| 340 | [ |
| 341 | if test -n "$withval" && test "x$withval" != "xno"; then |
| 342 | werror_flags="-Werror" |
| 343 | if test "x${withval}" != "xyes"; then |
| 344 | werror_flags="$withval" |
| 345 | fi |
| 346 | fi |
| 347 | ] |
| 348 | ) |
| 349 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 350 | AC_CHECK_HEADERS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 351 | blf.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 352 | bstring.h \ |
| 353 | crypt.h \ |
| 354 | crypto/sha2.h \ |
| 355 | dirent.h \ |
| 356 | endian.h \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 357 | elf.h \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 358 | err.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 359 | features.h \ |
| 360 | fcntl.h \ |
| 361 | floatingpoint.h \ |
| 362 | getopt.h \ |
| 363 | glob.h \ |
| 364 | ia.h \ |
| 365 | iaf.h \ |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 366 | inttypes.h \ |
Darren Tucker | f3f2cc8 | 2016-07-11 17:23:38 +1000 | [diff] [blame] | 367 | langinfo.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 368 | limits.h \ |
Darren Tucker | ae133d4 | 2013-06-06 08:30:20 +1000 | [diff] [blame] | 369 | locale.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 370 | login.h \ |
| 371 | maillock.h \ |
| 372 | ndir.h \ |
| 373 | net/if_tun.h \ |
| 374 | netdb.h \ |
| 375 | netgroup.h \ |
| 376 | pam/pam_appl.h \ |
| 377 | paths.h \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 378 | poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 379 | pty.h \ |
| 380 | readpassphrase.h \ |
| 381 | rpc/types.h \ |
| 382 | security/pam_appl.h \ |
| 383 | sha2.h \ |
| 384 | shadow.h \ |
| 385 | stddef.h \ |
| 386 | stdint.h \ |
| 387 | string.h \ |
| 388 | strings.h \ |
| 389 | sys/audit.h \ |
| 390 | sys/bitypes.h \ |
| 391 | sys/bsdtty.h \ |
| 392 | sys/cdefs.h \ |
| 393 | sys/dir.h \ |
| 394 | sys/mman.h \ |
| 395 | sys/ndir.h \ |
Darren Tucker | 7c92a65 | 2007-09-27 07:00:09 +1000 | [diff] [blame] | 396 | sys/poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 397 | sys/prctl.h \ |
| 398 | sys/pstat.h \ |
Darren Tucker | 5ee3fb5 | 2016-11-01 08:12:33 +1100 | [diff] [blame] | 399 | sys/ptrace.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 400 | sys/select.h \ |
| 401 | sys/stat.h \ |
| 402 | sys/stream.h \ |
| 403 | sys/stropts.h \ |
| 404 | sys/strtio.h \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 405 | sys/statvfs.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 406 | sys/sysmacros.h \ |
Damien Miller | 3235473 | 2017-10-25 11:25:43 +1100 | [diff] [blame^] | 407 | sys/sysctl.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 408 | sys/time.h \ |
| 409 | sys/timers.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 410 | time.h \ |
| 411 | tmpdir.h \ |
| 412 | ttyent.h \ |
Tim Rice | aa8954f | 2007-05-09 15:57:43 -0700 | [diff] [blame] | 413 | ucred.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 414 | unistd.h \ |
| 415 | usersec.h \ |
| 416 | util.h \ |
| 417 | utime.h \ |
| 418 | utmp.h \ |
| 419 | utmpx.h \ |
| 420 | vis.h \ |
Darren Tucker | f3f2cc8 | 2016-07-11 17:23:38 +1000 | [diff] [blame] | 421 | wchar.h \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 422 | ]) |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 423 | |
Darren Tucker | dd9d9b3 | 2017-08-28 16:48:27 +1000 | [diff] [blame] | 424 | # sys/capsicum.h requires sys/types.h |
| 425 | AC_CHECK_HEADERS([sys/capsicum.h], [], [], [ |
| 426 | #ifdef HAVE_SYS_TYPES_H |
| 427 | # include <sys/types.h> |
| 428 | #endif |
| 429 | ]) |
| 430 | |
Damien Miller | 3235473 | 2017-10-25 11:25:43 +1100 | [diff] [blame^] | 431 | # net/route.h requires sys/socket.h |
| 432 | AC_CHECK_HEADERS([net/route.h], [], [], [ |
| 433 | #include <sys/socket.h> |
| 434 | ]) |
| 435 | |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 436 | # lastlog.h requires sys/time.h to be included first on Solaris |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 437 | AC_CHECK_HEADERS([lastlog.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 438 | #ifdef HAVE_SYS_TIME_H |
| 439 | # include <sys/time.h> |
| 440 | #endif |
| 441 | ]) |
| 442 | |
| 443 | # 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] | 444 | AC_CHECK_HEADERS([sys/ptms.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 445 | #ifdef HAVE_SYS_STREAM_H |
| 446 | # include <sys/stream.h> |
| 447 | #endif |
| 448 | ]) |
| 449 | |
| 450 | # login_cap.h requires sys/types.h on NetBSD |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 451 | AC_CHECK_HEADERS([login_cap.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 452 | #include <sys/types.h> |
| 453 | ]) |
| 454 | |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 455 | # older BSDs need sys/param.h before sys/mount.h |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 456 | AC_CHECK_HEADERS([sys/mount.h], [], [], [ |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 457 | #include <sys/param.h> |
| 458 | ]) |
| 459 | |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 460 | # Android requires sys/socket.h to be included before sys/un.h |
| 461 | AC_CHECK_HEADERS([sys/un.h], [], [], [ |
Darren Tucker | 0b43ffe | 2013-06-03 09:30:44 +1000 | [diff] [blame] | 462 | #include <sys/types.h> |
Darren Tucker | 16cac19 | 2013-06-04 12:55:24 +1000 | [diff] [blame] | 463 | #include <sys/socket.h> |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 464 | ]) |
| 465 | |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 466 | # Messages for features tested for in target-specific section |
| 467 | SIA_MSG="no" |
| 468 | SPC_MSG="no" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 469 | SP_MSG="no" |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 470 | SPP_MSG="no" |
| 471 | |
| 472 | # Support for Solaris/Illumos privileges (this test is used by both |
| 473 | # the --with-solaris-privs option and --with-sandbox=solaris). |
| 474 | SOLARIS_PRIVS="no" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 475 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 476 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 477 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 478 | *-*-aix*) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 479 | # Some versions of VAC won't allow macro redefinitions at |
| 480 | # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that |
| 481 | # particularly with older versions of vac or xlc. |
| 482 | # It also throws errors about null macro argments, but these are |
| 483 | # not fatal. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 484 | AC_MSG_CHECKING([if compiler allows macro redefinitions]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 485 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 486 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 487 | #define testmacro foo |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 488 | #define testmacro bar]], |
| 489 | [[ exit(0); ]])], |
| 490 | [ AC_MSG_RESULT([yes]) ], |
| 491 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 492 | CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`" |
| 493 | LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`" |
| 494 | CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 495 | CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 496 | ] |
| 497 | ) |
| 498 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 499 | AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 500 | if (test -z "$blibpath"); then |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 501 | blibpath="/usr/lib:/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 502 | fi |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 503 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | bdc1212 | 2006-07-06 11:56:25 +1000 | [diff] [blame] | 504 | if test "$GCC" = "yes"; then |
| 505 | flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:" |
| 506 | else |
| 507 | flags="-blibpath: -Wl,-blibpath: -Wl,-rpath," |
| 508 | fi |
| 509 | for tryflags in $flags ;do |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 510 | if (test -z "$blibflags"); then |
| 511 | LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 512 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
| 513 | [blibflags=$tryflags], []) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 514 | fi |
| 515 | done |
| 516 | if (test -z "$blibflags"); then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 517 | AC_MSG_RESULT([not found]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 518 | AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log]) |
| 519 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 520 | AC_MSG_RESULT([$blibflags]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 521 | fi |
| 522 | LDFLAGS="$saved_LDFLAGS" |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 523 | dnl Check for authenticate. Might be in libs.a on older AIXes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 524 | AC_CHECK_FUNC([authenticate], [AC_DEFINE([WITH_AIXAUTHENTICATE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 525 | [Define if you want to enable AIX4's authenticate function])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 526 | [AC_CHECK_LIB([s], [authenticate], |
| 527 | [ AC_DEFINE([WITH_AIXAUTHENTICATE]) |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 528 | LIBS="$LIBS -ls" |
| 529 | ]) |
| 530 | ]) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 531 | dnl Check for various auth function declarations in headers. |
Darren Tucker | 04cfbe0 | 2005-02-20 23:27:11 +1100 | [diff] [blame] | 532 | AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, |
Darren Tucker | e66519d | 2005-03-21 22:46:34 +1100 | [diff] [blame] | 533 | passwdexpired, setauthdb], , , [#include <usersec.h>]) |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 534 | 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] | 535 | AC_CHECK_DECLS([loginfailed], |
| 536 | [AC_MSG_CHECKING([if loginfailed takes 4 arguments]) |
| 537 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <usersec.h> ]], |
| 538 | [[ (void)loginfailed("user","host","tty",0); ]])], |
| 539 | [AC_MSG_RESULT([yes]) |
| 540 | AC_DEFINE([AIX_LOGINFAILED_4ARG], [1], |
| 541 | [Define if your AIX loginfailed() function |
| 542 | takes 4 arguments (AIX >= 5.2)])], [AC_MSG_RESULT([no]) |
| 543 | ])], |
| 544 | [], |
| 545 | [#include <usersec.h>] |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 546 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 547 | AC_CHECK_FUNCS([getgrset setauthdb]) |
| 548 | AC_CHECK_DECL([F_CLOSEM], |
| 549 | AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]), |
Darren Tucker | 3083bc2 | 2006-08-17 19:35:49 +1000 | [diff] [blame] | 550 | [], |
| 551 | [ #include <limits.h> |
| 552 | #include <fcntl.h> ] |
| 553 | ) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 554 | check_for_aix_broken_getaddrinfo=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 555 | AC_DEFINE([BROKEN_REALPATH], [1], [Define if you have a broken realpath.]) |
| 556 | AC_DEFINE([SETEUID_BREAKS_SETUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 557 | [Define if your platform breaks doing a seteuid before a setuid]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 558 | AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken]) |
| 559 | AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken]) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 560 | dnl AIX handles lastlog as part of its login message |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 561 | AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog]) |
| 562 | AC_DEFINE([LOGIN_NEEDS_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 563 | [Some systems need a utmpx entry for /bin/login to work]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 564 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 565 | [Define to a Set Process Title type if your system is |
| 566 | supported by bsd-setproctitle.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 567 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Darren Tucker | 91d25a0 | 2005-11-26 22:24:09 +1100 | [diff] [blame] | 568 | [AIX 5.2 and 5.3 (and presumably newer) require this]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 569 | 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] | 570 | 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] | 571 | ;; |
Darren Tucker | 898ac93 | 2013-06-03 02:03:25 +1000 | [diff] [blame] | 572 | *-*-android*) |
| 573 | AC_DEFINE([DISABLE_UTMP], [1], [Define if you don't want to use utmp]) |
| 574 | AC_DEFINE([DISABLE_WTMP], [1], [Define if you don't want to use wtmp]) |
| 575 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 576 | *-*-cygwin*) |
Damien Miller | c8936ac | 2003-02-11 10:04:03 +1100 | [diff] [blame] | 577 | check_for_libcrypt_later=1 |
Darren Tucker | 573e387 | 2007-03-02 17:50:03 +1100 | [diff] [blame] | 578 | LIBS="$LIBS /usr/lib/textreadmode.o" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 579 | AC_DEFINE([HAVE_CYGWIN], [1], [Define if you are on Cygwin]) |
| 580 | AC_DEFINE([USE_PIPES], [1], [Use PIPES instead of a socketpair()]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 581 | AC_DEFINE([NO_UID_RESTORATION_TEST], [1], |
| 582 | [Define to disable UID restoration test]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 583 | AC_DEFINE([DISABLE_SHADOW], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 584 | [Define if you want to disable shadow passwords]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 585 | AC_DEFINE([NO_X11_UNIX_SOCKETS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 586 | [Define if X11 doesn't support AF_UNIX sockets on that system]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 587 | AC_DEFINE([DISABLE_FD_PASSING], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 588 | [Define if your platform needs to skip post auth |
| 589 | file descriptor passing]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 590 | AC_DEFINE([SSH_IOBUFSZ], [65535], [Windows is sensitive to read buffer size]) |
Darren Tucker | fdce373 | 2014-01-18 21:12:42 +1100 | [diff] [blame] | 591 | AC_DEFINE([FILESYSTEM_NO_BACKSLASH], [1], [File names may not contain backslash characters]) |
| 592 | # Cygwin defines optargs, optargs as declspec(dllimport) for historical |
| 593 | # reasons which cause compile warnings, so we disable those warnings. |
| 594 | OSSH_CHECK_CFLAG_COMPILE([-Wno-attributes]) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 595 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 596 | *-*-dgux*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 597 | AC_DEFINE([IP_TOS_IS_BROKEN], [1], |
Tim Rice | a74000e | 2009-03-18 11:25:02 -0700 | [diff] [blame] | 598 | [Define if your system choked on IP TOS setting]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 599 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 600 | AC_DEFINE([BROKEN_SETREUID]) |
| 601 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 602 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 603 | *-*-darwin*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 604 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 605 | AC_MSG_CHECKING([if we have working getaddrinfo]) |
| 606 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 607 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
| 608 | exit(0); |
| 609 | else |
| 610 | exit(1); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 611 | } |
| 612 | ]])], |
| 613 | [AC_MSG_RESULT([working])], |
| 614 | [AC_MSG_RESULT([buggy]) |
| 615 | AC_DEFINE([BROKEN_GETADDRINFO], [1], |
| 616 | [getaddrinfo is broken (if present)]) |
| 617 | ], |
| 618 | [AC_MSG_RESULT([assume it is working])]) |
| 619 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 620 | AC_DEFINE([BROKEN_SETREUID]) |
| 621 | AC_DEFINE([BROKEN_SETREGID]) |
| 622 | AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect]) |
| 623 | AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 624 | [Define if your resolver libs need this for getrrsetbyname]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 625 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
| 626 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 627 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 628 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 629 | [Prepend the address family to IP tunnel traffic]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 630 | m4_pattern_allow([AU_IPv]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 631 | AC_CHECK_DECL([AU_IPv4], [], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 632 | AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 633 | [#include <bsm/audit.h>] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 634 | AC_DEFINE([LASTLOG_WRITE_PUTUTXLINE], [1], |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 635 | [Define if pututxline updates lastlog too]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 636 | ) |
Damien Miller | c09182f | 2011-06-03 12:11:38 +1000 | [diff] [blame] | 637 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
| 638 | [Define to a Set Process Title type if your system is |
| 639 | supported by bsd-setproctitle.c]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 640 | AC_CHECK_FUNCS([sandbox_init]) |
| 641 | AC_CHECK_HEADERS([sandbox.h]) |
Damien Miller | 39f303b | 2016-02-23 12:56:59 +1100 | [diff] [blame] | 642 | AC_CHECK_LIB([sandbox], [sandbox_apply], [ |
| 643 | SSHDLIBS="$SSHDLIBS -lsandbox" |
| 644 | ]) |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 645 | ;; |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 646 | *-*-dragonfly*) |
| 647 | SSHDLIBS="$SSHDLIBS -lcrypt" |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 648 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 649 | ;; |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 650 | *-*-haiku*) |
Darren Tucker | 5faa52d | 2016-08-02 15:22:40 +1000 | [diff] [blame] | 651 | LIBS="$LIBS -lbsd " |
| 652 | AC_CHECK_LIB([network], [socket]) |
| 653 | AC_DEFINE([HAVE_U_INT64_T]) |
| 654 | MANTYPE=man |
| 655 | ;; |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 656 | *-*-hpux*) |
| 657 | # 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] | 658 | 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] | 659 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 660 | AC_DEFINE([USE_PIPES]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 661 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
| 662 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 663 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 664 | AC_DEFINE([SPT_TYPE], [SPT_PSTAT]) |
Darren Tucker | aa97d13 | 2013-03-12 11:31:05 +1100 | [diff] [blame] | 665 | 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] | 666 | maildir="/var/mail" |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 667 | LIBS="$LIBS -lsec" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 668 | AC_CHECK_LIB([xnet], [t_error], , |
| 669 | [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 670 | |
| 671 | # next, we define all of the options specific to major releases |
| 672 | case "$host" in |
| 673 | *-*-hpux10*) |
| 674 | if test -z "$GCC"; then |
| 675 | CFLAGS="$CFLAGS -Ae" |
| 676 | fi |
| 677 | ;; |
| 678 | *-*-hpux11*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 679 | AC_DEFINE([PAM_SUN_CODEBASE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 680 | [Define if you are using Solaris-derived PAM which |
| 681 | passes pam_messages to the conversation function |
| 682 | with an extra level of indirection]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 683 | AC_DEFINE([DISABLE_UTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 684 | [Define if you don't want to use utmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 685 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 686 | check_for_hpux_broken_getaddrinfo=1 |
| 687 | check_for_conflicting_getspnam=1 |
| 688 | ;; |
| 689 | esac |
| 690 | |
| 691 | # lastly, we define options specific to minor releases |
| 692 | case "$host" in |
| 693 | *-*-hpux10.26) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 694 | AC_DEFINE([HAVE_SECUREWARE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 695 | [Define if you have SecureWare-based |
| 696 | protected password database]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 697 | disable_ptmx_check=yes |
| 698 | LIBS="$LIBS -lsecpw" |
| 699 | ;; |
| 700 | esac |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 701 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 702 | *-*-irix5*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 703 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 704 | AC_DEFINE([BROKEN_INET_NTOA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 705 | [Define if you system's inet_ntoa is busted |
| 706 | (e.g. Irix gcc issue)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 707 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 708 | AC_DEFINE([BROKEN_SETREUID]) |
| 709 | AC_DEFINE([BROKEN_SETREGID]) |
| 710 | AC_DEFINE([WITH_ABBREV_NO_TTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 711 | [Define if you shouldn't strip 'tty' from your |
| 712 | ttyname in [uw]tmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 713 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 714 | ;; |
| 715 | *-*-irix6*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 716 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 717 | AC_DEFINE([WITH_IRIX_ARRAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 718 | [Define if you have/want arrays |
| 719 | (cluster-wide session managment, not C arrays)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 720 | AC_DEFINE([WITH_IRIX_PROJECT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 721 | [Define if you want IRIX project management]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 722 | AC_DEFINE([WITH_IRIX_AUDIT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 723 | [Define if you want IRIX audit trails]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 724 | AC_CHECK_FUNC([jlimit_startjob], [AC_DEFINE([WITH_IRIX_JOBS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 725 | [Define if you want IRIX kernel jobs])]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 726 | AC_DEFINE([BROKEN_INET_NTOA]) |
| 727 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 728 | AC_DEFINE([BROKEN_SETREUID]) |
| 729 | AC_DEFINE([BROKEN_SETREGID]) |
| 730 | AC_DEFINE([BROKEN_UPDWTMPX], [1], [updwtmpx is broken (if present)]) |
| 731 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 732 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 733 | ;; |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 734 | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) |
| 735 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 736 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 737 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"]) |
| 738 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 739 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 740 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 741 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 742 | *-*-linux*) |
| 743 | no_dev_ptmx=1 |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 744 | use_pie=auto |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 745 | check_for_libcrypt_later=1 |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 746 | check_for_openpty_ctty_bug=1 |
Darren Tucker | c61d5ec | 2017-02-03 14:10:34 +1100 | [diff] [blame] | 747 | dnl Target SUSv3/POSIX.1-2001 plus BSD specifics. |
| 748 | dnl _DEFAULT_SOURCE is the new name for _BSD_SOURCE |
| 749 | CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 750 | AC_DEFINE([PAM_TTY_KLUDGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 751 | [Work around problematic Linux PAM modules handling of PAM_TTY]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 752 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 753 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 754 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 755 | AC_DEFINE([LINK_OPNOTSUPP_ERRNO], [EPERM], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 756 | [Define to whatever link() returns for "not supported" |
| 757 | if it doesn't return EOPNOTSUPP.]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 758 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 759 | AC_DEFINE([USE_BTMP]) |
| 760 | AC_DEFINE([LINUX_OOM_ADJUST], [1], [Adjust Linux out-of-memory killer]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 761 | inet6_default_4in6=yes |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 762 | case `uname -r` in |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 763 | 1.*|2.0.*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 764 | AC_DEFINE([BROKEN_CMSG_TYPE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 765 | [Define if cmsg_type is not passed correctly]) |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 766 | ;; |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 767 | esac |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 768 | # tun(4) forwarding compat code |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 769 | AC_CHECK_HEADERS([linux/if_tun.h]) |
Damien Miller | bd4e410 | 2006-01-01 21:03:30 +1100 | [diff] [blame] | 770 | if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 771 | AC_DEFINE([SSH_TUN_LINUX], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 772 | [Open tunnel devices the Linux tun/tap way]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 773 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 774 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 775 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 776 | [Prepend the address family to IP tunnel traffic]) |
| 777 | fi |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 778 | AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h], [], |
| 779 | [], [#include <linux/types.h>]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 780 | AC_MSG_CHECKING([for seccomp architecture]) |
| 781 | seccomp_audit_arch= |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 782 | case "$host" in |
| 783 | x86_64-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 784 | seccomp_audit_arch=AUDIT_ARCH_X86_64 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 785 | ;; |
| 786 | i*86-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 787 | seccomp_audit_arch=AUDIT_ARCH_I386 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 788 | ;; |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 789 | arm*-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 790 | seccomp_audit_arch=AUDIT_ARCH_ARM |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 791 | ;; |
| 792 | aarch64*-*) |
| 793 | seccomp_audit_arch=AUDIT_ARCH_AARCH64 |
Damien Miller | 5c15e22 | 2015-06-18 15:07:56 +1000 | [diff] [blame] | 794 | ;; |
Damien Miller | b9c5061 | 2016-07-08 13:59:13 +1000 | [diff] [blame] | 795 | s390x-*) |
| 796 | seccomp_audit_arch=AUDIT_ARCH_S390X |
| 797 | ;; |
| 798 | s390-*) |
| 799 | seccomp_audit_arch=AUDIT_ARCH_S390 |
| 800 | ;; |
| 801 | powerpc64-*) |
| 802 | seccomp_audit_arch=AUDIT_ARCH_PPC64 |
| 803 | ;; |
| 804 | powerpc64le-*) |
| 805 | seccomp_audit_arch=AUDIT_ARCH_PPC64LE |
| 806 | ;; |
| 807 | mips-*) |
| 808 | seccomp_audit_arch=AUDIT_ARCH_MIPS |
| 809 | ;; |
| 810 | mipsel-*) |
| 811 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL |
| 812 | ;; |
| 813 | mips64-*) |
| 814 | seccomp_audit_arch=AUDIT_ARCH_MIPS64 |
| 815 | ;; |
| 816 | mips64el-*) |
| 817 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL64 |
| 818 | ;; |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 819 | esac |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 820 | if test "x$seccomp_audit_arch" != "x" ; then |
| 821 | AC_MSG_RESULT(["$seccomp_audit_arch"]) |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 822 | AC_DEFINE_UNQUOTED([SECCOMP_AUDIT_ARCH], [$seccomp_audit_arch], |
| 823 | [Specify the system call convention in use]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 824 | else |
| 825 | AC_MSG_RESULT([architecture not supported]) |
| 826 | fi |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 827 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 828 | mips-sony-bsd|mips-sony-newsos4) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 829 | AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to acquire controlling tty]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 830 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 831 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 832 | *-*-netbsd*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 833 | check_for_libcrypt_before=1 |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 834 | if test "x$withval" != "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 835 | need_dash_r=1 |
| 836 | fi |
Damien Miller | 99522ba | 2016-07-28 08:54:27 +1000 | [diff] [blame] | 837 | CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 838 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 839 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 840 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 841 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 842 | [Prepend the address family to IP tunnel traffic]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 843 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | f5bbd3b | 2014-01-30 11:26:46 +1100 | [diff] [blame] | 844 | AC_DEFINE([BROKEN_READ_COMPARISON], [1], |
| 845 | [NetBSD read function is sometimes redirected, breaking atomicio comparisons against it]) |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 846 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 847 | *-*-freebsd*) |
| 848 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 849 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["*LOCKED*"], [Account locked with pw(1)]) |
| 850 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 851 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 852 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 853 | 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] | 854 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | 2035b22 | 2014-01-26 09:39:53 +1100 | [diff] [blame] | 855 | # Preauth crypto occasionally uses file descriptors for crypto offload |
| 856 | # and will crash if they cannot be opened. |
Damien Miller | 5b447c0 | 2014-01-26 09:46:53 +1100 | [diff] [blame] | 857 | AC_DEFINE([SANDBOX_SKIP_RLIMIT_NOFILE], [1], |
Tim Rice | 03ae081 | 2014-02-21 09:09:34 -0800 | [diff] [blame] | 858 | [define if setrlimit RLIMIT_NOFILE breaks things]) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 859 | ;; |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 860 | *-*-bsdi*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 861 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 862 | AC_DEFINE([BROKEN_SETREUID]) |
| 863 | AC_DEFINE([BROKEN_SETREGID]) |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 864 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 865 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 866 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 867 | conf_utmp_location=/etc/utmp |
| 868 | conf_wtmp_location=/usr/adm/wtmp |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 869 | maildir=/usr/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 870 | AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) |
| 871 | AC_DEFINE([BROKEN_REALPATH]) |
| 872 | AC_DEFINE([USE_PIPES]) |
| 873 | AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 874 | ;; |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 875 | *-*-openbsd*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 876 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 877 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) |
| 878 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) |
| 879 | AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) |
| 880 | AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1], |
Damien Miller | bb59814 | 2006-08-19 08:38:23 +1000 | [diff] [blame] | 881 | [syslog_r function is safe to use in in a signal handler]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 882 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 883 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 884 | *-*-solaris*) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 885 | if test "x$withval" != "xno" ; then |
Tim Rice | ad4a188 | 2004-02-29 15:53:37 -0800 | [diff] [blame] | 886 | need_dash_r=1 |
| 887 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 888 | AC_DEFINE([PAM_SUN_CODEBASE]) |
| 889 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 890 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 891 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 892 | [Define if pam_chauthtok wants real uid set |
| 893 | to the unpriv'ed user]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 894 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 895 | # Pushing STREAMS modules will cause sshd to acquire a controlling tty. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 896 | AC_DEFINE([SSHD_ACQUIRES_CTTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 897 | [Define if sshd somehow reacquires a controlling TTY |
| 898 | after setsid()]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 899 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd |
Darren Tucker | 0249f93 | 2006-06-24 12:10:07 +1000 | [diff] [blame] | 900 | in case the name is longer than 8 chars]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 901 | AC_DEFINE([BROKEN_TCGETATTR_ICANON], [1], [tcgetattr with ICANON may hang]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 902 | external_path_file=/etc/default/login |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 903 | # hardwire lastlog location (can't detect it on some versions) |
| 904 | conf_lastlog_location="/var/adm/lastlog" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 905 | AC_MSG_CHECKING([for obsolete utmp and wtmp in solaris2.x]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 906 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 907 | if test "$sol2ver" -ge 8; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 908 | AC_MSG_RESULT([yes]) |
| 909 | AC_DEFINE([DISABLE_UTMP]) |
| 910 | AC_DEFINE([DISABLE_WTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 911 | [Define if you don't want to use wtmp]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 912 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 913 | AC_MSG_RESULT([no]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 914 | fi |
Darren Tucker | a86ec4d | 2016-06-14 10:48:27 +1000 | [diff] [blame] | 915 | AC_CHECK_FUNCS([setpflags]) |
Darren Tucker | 907091a | 2016-02-19 09:05:39 +1100 | [diff] [blame] | 916 | AC_CHECK_FUNCS([setppriv]) |
| 917 | AC_CHECK_FUNCS([priv_basicset]) |
| 918 | AC_CHECK_HEADERS([priv.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 919 | AC_ARG_WITH([solaris-contracts], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 920 | [ --with-solaris-contracts Enable Solaris process contracts (experimental)], |
| 921 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 922 | AC_CHECK_LIB([contract], [ct_tmpl_activate], |
| 923 | [ AC_DEFINE([USE_SOLARIS_PROCESS_CONTRACTS], [1], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 924 | [Define if you have Solaris process contracts]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 925 | LIBS="$LIBS -lcontract" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 926 | SPC_MSG="yes" ], ) |
| 927 | ], |
| 928 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 929 | AC_ARG_WITH([solaris-projects], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 930 | [ --with-solaris-projects Enable Solaris projects (experimental)], |
| 931 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 932 | AC_CHECK_LIB([project], [setproject], |
| 933 | [ AC_DEFINE([USE_SOLARIS_PROJECTS], [1], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 934 | [Define if you have Solaris projects]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 935 | LIBS="$LIBS -lproject" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 936 | SP_MSG="yes" ], ) |
| 937 | ], |
| 938 | ) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 939 | AC_ARG_WITH([solaris-privs], |
| 940 | [ --with-solaris-privs Enable Solaris/Illumos privileges (experimental)], |
| 941 | [ |
| 942 | AC_MSG_CHECKING([for Solaris/Illumos privilege support]) |
Darren Tucker | 907091a | 2016-02-19 09:05:39 +1100 | [diff] [blame] | 943 | if test "x$ac_cv_func_setppriv" = "xyes" -a \ |
| 944 | "x$ac_cv_header_priv_h" = "xyes" ; then |
| 945 | SOLARIS_PRIVS=yes |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 946 | AC_MSG_RESULT([found]) |
| 947 | AC_DEFINE([NO_UID_RESTORATION_TEST], [1], |
| 948 | [Define to disable UID restoration test]) |
| 949 | AC_DEFINE([USE_SOLARIS_PRIVS], [1], |
| 950 | [Define if you have Solaris privileges]) |
| 951 | SPP_MSG="yes" |
| 952 | else |
| 953 | AC_MSG_RESULT([not found]) |
| 954 | AC_MSG_ERROR([*** must have support for Solaris privileges to use --with-solaris-privs]) |
| 955 | fi |
| 956 | ], |
| 957 | ) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 958 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 959 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 960 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 961 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 962 | AC_CHECK_FUNCS([getpwanam]) |
| 963 | AC_DEFINE([PAM_SUN_CODEBASE]) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 964 | conf_utmp_location=/etc/utmp |
| 965 | conf_wtmp_location=/var/adm/wtmp |
| 966 | conf_lastlog_location=/var/adm/lastlog |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 967 | AC_DEFINE([USE_PIPES]) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 968 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 969 | *-ncr-sysv*) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 970 | LIBS="$LIBS -lc89" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 971 | AC_DEFINE([USE_PIPES]) |
| 972 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 973 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 974 | AC_DEFINE([BROKEN_SETREUID]) |
| 975 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 976 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 977 | *-sni-sysv*) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 978 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 979 | AC_CHECK_LIB([dl], [dlsym], ,) |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 980 | # -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] | 981 | AC_CHECK_LIB([resolv], [res_query], [ LIBS="$LIBS -lresolv" ]) |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 982 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 983 | AC_DEFINE([USE_PIPES]) |
| 984 | AC_DEFINE([IP_TOS_IS_BROKEN]) |
| 985 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 986 | AC_DEFINE([BROKEN_SETREUID]) |
| 987 | AC_DEFINE([BROKEN_SETREGID]) |
| 988 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 989 | external_path_file=/etc/default/login |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 990 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 991 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 992 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 993 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 994 | # 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] | 995 | *-*-sysv4.2*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 996 | AC_DEFINE([USE_PIPES]) |
| 997 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 998 | AC_DEFINE([BROKEN_SETREUID]) |
| 999 | AC_DEFINE([BROKEN_SETREGID]) |
| 1000 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd]) |
| 1001 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1002 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1003 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1004 | # UnixWare 7.x, OpenUNIX 8 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1005 | *-*-sysv5*) |
Tim Rice | 641ebf1 | 2010-01-17 17:05:39 -0800 | [diff] [blame] | 1006 | CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1007 | AC_DEFINE([UNIXWARE_LONG_PASSWORDS], [1], [Support passwords > 8 chars]) |
| 1008 | AC_DEFINE([USE_PIPES]) |
| 1009 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1010 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1011 | AC_DEFINE([BROKEN_SETREUID]) |
| 1012 | AC_DEFINE([BROKEN_SETREGID]) |
| 1013 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
Tim Rice | 8433d51 | 2017-07-11 18:47:56 -0700 | [diff] [blame] | 1014 | AC_DEFINE([BROKEN_TCGETATTR_ICANON]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1015 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1016 | case "$host" in |
| 1017 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 1018 | maildir=/var/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1019 | AC_DEFINE([BROKEN_LIBIAF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1020 | [ia_uinfo routines not supported by OS yet]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1021 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 1022 | AC_CHECK_LIB([prot], [getluid], [ LIBS="$LIBS -lprot" |
| 1023 | AC_CHECK_FUNCS([getluid setluid], , , [-lprot]) |
| 1024 | AC_DEFINE([HAVE_SECUREWARE]) |
| 1025 | AC_DEFINE([DISABLE_SHADOW]) |
| 1026 | ], , ) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1027 | ;; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1028 | *) AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 2676791 | 2009-01-07 20:50:08 -0800 | [diff] [blame] | 1029 | check_for_libcrypt_later=1 |
Tim Rice | 46259d8 | 2005-11-28 18:40:34 -0800 | [diff] [blame] | 1030 | ;; |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1031 | esac |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1032 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1033 | *-*-sysv*) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1034 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1035 | # SCO UNIX and OEM versions of SCO UNIX |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1036 | *-*-sco3.2v4*) |
Tim Rice | c390c8d | 2005-03-07 01:21:37 -0800 | [diff] [blame] | 1037 | AC_MSG_ERROR("This Platform is no longer supported.") |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1038 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1039 | # SCO OpenServer 5.x |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1040 | *-*-sco3.2v5*) |
Tim Rice | 89fe3f3 | 2003-01-19 20:20:24 -0800 | [diff] [blame] | 1041 | if test -z "$GCC"; then |
| 1042 | CFLAGS="$CFLAGS -belf" |
| 1043 | fi |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 1044 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1045 | no_dev_ptmx=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1046 | AC_DEFINE([USE_PIPES]) |
| 1047 | AC_DEFINE([HAVE_SECUREWARE]) |
| 1048 | AC_DEFINE([DISABLE_SHADOW]) |
| 1049 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 1050 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1051 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1052 | AC_DEFINE([BROKEN_SETREUID]) |
| 1053 | AC_DEFINE([BROKEN_SETREGID]) |
| 1054 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1055 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 1056 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
| 1057 | AC_CHECK_FUNCS([getluid setluid]) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 1058 | MANTYPE=man |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1059 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 1060 | SKIP_DISABLE_LASTLOG_DEFINE=yes |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1061 | ;; |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1062 | *-*-unicosmk*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1063 | AC_DEFINE([NO_SSH_LASTLOG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1064 | [Define if you don't want to use lastlog in session.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1065 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1066 | AC_DEFINE([BROKEN_SETREUID]) |
| 1067 | AC_DEFINE([BROKEN_SETREGID]) |
| 1068 | AC_DEFINE([USE_PIPES]) |
| 1069 | AC_DEFINE([DISABLE_FD_PASSING]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1070 | LDFLAGS="$LDFLAGS" |
| 1071 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 1072 | MANTYPE=cat |
Ben Lindstrom | 762104e | 2002-07-23 00:00:05 +0000 | [diff] [blame] | 1073 | ;; |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1074 | *-*-unicosmp*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1075 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1076 | AC_DEFINE([BROKEN_SETREUID]) |
| 1077 | AC_DEFINE([BROKEN_SETREGID]) |
| 1078 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1079 | AC_DEFINE([USE_PIPES]) |
| 1080 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1081 | LDFLAGS="$LDFLAGS" |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 1082 | LIBS="$LIBS -lgen -lacid -ldb" |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1083 | MANTYPE=cat |
| 1084 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 1085 | *-*-unicos*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1086 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1087 | AC_DEFINE([BROKEN_SETREUID]) |
| 1088 | AC_DEFINE([BROKEN_SETREGID]) |
| 1089 | AC_DEFINE([USE_PIPES]) |
| 1090 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 1091 | AC_DEFINE([NO_SSH_LASTLOG]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1092 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" |
| 1093 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 1094 | MANTYPE=cat |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 1095 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1096 | *-dec-osf*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1097 | AC_MSG_CHECKING([for Digital Unix SIA]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1098 | no_osfsia="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1099 | AC_ARG_WITH([osfsia], |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1100 | [ --with-osfsia Enable Digital Unix SIA], |
| 1101 | [ |
| 1102 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1103 | AC_MSG_RESULT([disabled]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1104 | no_osfsia=1 |
| 1105 | fi |
| 1106 | ], |
| 1107 | ) |
| 1108 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1109 | if test -f /etc/sia/matrix.conf; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1110 | AC_MSG_RESULT([yes]) |
| 1111 | AC_DEFINE([HAVE_OSF_SIA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1112 | [Define if you have Digital Unix Security |
| 1113 | Integration Architecture]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1114 | AC_DEFINE([DISABLE_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1115 | [Define if you don't want to use your |
| 1116 | system's login() call]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1117 | AC_DEFINE([DISABLE_FD_PASSING]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1118 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 1119 | SIA_MSG="yes" |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1120 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1121 | AC_MSG_RESULT([no]) |
| 1122 | AC_DEFINE([LOCKED_PASSWD_SUBSTR], ["Nologin"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1123 | [String used in /etc/passwd to denote locked account]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1124 | fi |
| 1125 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1126 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1127 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1128 | AC_DEFINE([BROKEN_SETREUID]) |
| 1129 | AC_DEFINE([BROKEN_SETREGID]) |
| 1130 | AC_DEFINE([BROKEN_READV_COMPARISON], [1], [Can't do comparisons on readv]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1131 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1132 | |
Tim Rice | 70335a6 | 2006-02-04 17:42:58 -0800 | [diff] [blame] | 1133 | *-*-nto-qnx*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1134 | AC_DEFINE([USE_PIPES]) |
| 1135 | AC_DEFINE([NO_X11_UNIX_SOCKETS]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1136 | AC_DEFINE([DISABLE_LASTLOG]) |
| 1137 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 1138 | AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken]) |
Tim Rice | 2f99346 | 2006-02-11 18:37:48 -0800 | [diff] [blame] | 1139 | enable_etc_default_login=no # has incompatible /etc/default/login |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1140 | case "$host" in |
| 1141 | *-*-nto-qnx6*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1142 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1143 | ;; |
| 1144 | esac |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1145 | ;; |
Darren Tucker | 2be1cbb | 2005-05-27 21:13:40 +1000 | [diff] [blame] | 1146 | |
| 1147 | *-*-ultrix*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1148 | AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1149 | AC_DEFINE([NEED_SETPGRP]) |
| 1150 | 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] | 1151 | ;; |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 1152 | |
| 1153 | *-*-lynxos) |
Darren Tucker | 5faa52d | 2016-08-02 15:22:40 +1000 | [diff] [blame] | 1154 | CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" |
| 1155 | AC_DEFINE([BROKEN_SETVBUF], [1], |
| 1156 | [LynxOS has broken setvbuf() implementation]) |
| 1157 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1158 | esac |
| 1159 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1160 | AC_MSG_CHECKING([compiler and flags for sanity]) |
| 1161 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])], |
| 1162 | [ AC_MSG_RESULT([yes]) ], |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1163 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1164 | AC_MSG_RESULT([no]) |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1165 | AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1166 | ], |
| 1167 | [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1168 | ) |
| 1169 | |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1170 | dnl Checks for header files. |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1171 | # Checks for libraries. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1172 | AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])]) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1173 | |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1174 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1175 | AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [ |
| 1176 | AC_CHECK_LIB([gen], [dirname], [ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1177 | AC_CACHE_CHECK([for broken dirname], |
| 1178 | ac_cv_have_broken_dirname, [ |
| 1179 | save_LIBS="$LIBS" |
| 1180 | LIBS="$LIBS -lgen" |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1181 | AC_RUN_IFELSE( |
| 1182 | [AC_LANG_SOURCE([[ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1183 | #include <libgen.h> |
| 1184 | #include <string.h> |
| 1185 | |
| 1186 | int main(int argc, char **argv) { |
| 1187 | char *s, buf[32]; |
| 1188 | |
| 1189 | strncpy(buf,"/etc", 32); |
| 1190 | s = dirname(buf); |
| 1191 | if (!s || strncmp(s, "/", 32) != 0) { |
| 1192 | exit(1); |
| 1193 | } else { |
| 1194 | exit(0); |
| 1195 | } |
| 1196 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1197 | ]])], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1198 | [ ac_cv_have_broken_dirname="no" ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1199 | [ ac_cv_have_broken_dirname="yes" ], |
| 1200 | [ ac_cv_have_broken_dirname="no" ], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1201 | ) |
| 1202 | LIBS="$save_LIBS" |
| 1203 | ]) |
| 1204 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
| 1205 | LIBS="$LIBS -lgen" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1206 | AC_DEFINE([HAVE_DIRNAME]) |
| 1207 | AC_CHECK_HEADERS([libgen.h]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1208 | fi |
| 1209 | ]) |
| 1210 | ]) |
| 1211 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1212 | AC_CHECK_FUNC([getspnam], , |
| 1213 | [AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])]) |
| 1214 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], |
| 1215 | [Define if you have the basename function.])]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1216 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1217 | dnl zlib is required |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1218 | AC_ARG_WITH([zlib], |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1219 | [ --with-zlib=PATH Use zlib in PATH], |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1220 | [ if test "x$withval" = "xno" ; then |
| 1221 | AC_MSG_ERROR([*** zlib is required ***]) |
| 1222 | elif test "x$withval" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1223 | if test -d "$withval/lib"; then |
| 1224 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1225 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1226 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1227 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1228 | fi |
| 1229 | else |
| 1230 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1231 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1232 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1233 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1234 | fi |
| 1235 | fi |
| 1236 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1237 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1238 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1239 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1240 | fi |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1241 | fi ] |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1242 | ) |
| 1243 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1244 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) |
| 1245 | AC_CHECK_LIB([z], [deflate], , |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1246 | [ |
| 1247 | saved_CPPFLAGS="$CPPFLAGS" |
| 1248 | saved_LDFLAGS="$LDFLAGS" |
| 1249 | save_LIBS="$LIBS" |
| 1250 | dnl Check default zlib install dir |
| 1251 | if test -n "${need_dash_r}"; then |
| 1252 | LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}" |
| 1253 | else |
| 1254 | LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" |
| 1255 | fi |
| 1256 | CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" |
| 1257 | LIBS="$LIBS -lz" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1258 | AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])], |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1259 | [ |
| 1260 | AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) |
| 1261 | ] |
| 1262 | ) |
| 1263 | ] |
| 1264 | ) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1265 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1266 | AC_ARG_WITH([zlib-version-check], |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1267 | [ --without-zlib-version-check Disable zlib version check], |
| 1268 | [ if test "x$withval" = "xno" ; then |
| 1269 | zlib_check_nonfatal=1 |
| 1270 | fi |
| 1271 | ] |
| 1272 | ) |
| 1273 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1274 | AC_MSG_CHECKING([for possibly buggy zlib]) |
| 1275 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1276 | #include <stdio.h> |
Darren Tucker | c8a0f27 | 2013-03-22 12:49:14 +1100 | [diff] [blame] | 1277 | #include <stdlib.h> |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1278 | #include <zlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1279 | ]], |
| 1280 | [[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1281 | int a=0, b=0, c=0, d=0, n, v; |
| 1282 | n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); |
| 1283 | if (n != 3 && n != 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1284 | exit(1); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1285 | v = a*1000000 + b*10000 + c*100 + d; |
| 1286 | fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); |
| 1287 | |
| 1288 | /* 1.1.4 is OK */ |
| 1289 | if (a == 1 && b == 1 && c >= 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1290 | exit(0); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1291 | |
Darren Tucker | 41097ed | 2005-07-25 15:24:21 +1000 | [diff] [blame] | 1292 | /* 1.2.3 and up are OK */ |
| 1293 | if (v >= 1020300) |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1294 | exit(0); |
| 1295 | |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1296 | exit(2); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1297 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1298 | AC_MSG_RESULT([no]), |
| 1299 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1300 | if test -z "$zlib_check_nonfatal" ; then |
| 1301 | AC_MSG_ERROR([*** zlib too old - check config.log *** |
| 1302 | Your reported zlib version has known security problems. It's possible your |
| 1303 | vendor has fixed these problems without changing the version number. If you |
| 1304 | are sure this is the case, you can disable the check by running |
| 1305 | "./configure --without-zlib-version-check". |
Darren Tucker | ac1910f | 2005-07-26 12:00:42 +1000 | [diff] [blame] | 1306 | 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] | 1307 | See http://www.gzip.org/zlib/ for details.]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1308 | else |
| 1309 | AC_MSG_WARN([zlib version may have security problems]) |
| 1310 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1311 | ], |
| 1312 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1313 | ) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1314 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1315 | dnl UnixWare 2.x |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1316 | AC_CHECK_FUNC([strcasecmp], |
| 1317 | [], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1318 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1319 | AC_CHECK_FUNCS([utimes], |
| 1320 | [], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES]) |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 1321 | LIBS="$LIBS -lc89"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1322 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1323 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1324 | dnl Checks for libutil functions |
Damien Miller | b87f6b7 | 2013-02-23 09:12:23 +1100 | [diff] [blame] | 1325 | AC_CHECK_HEADERS([bsd/libutil.h libutil.h]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1326 | AC_SEARCH_LIBS([fmt_scaled], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1327 | AC_SEARCH_LIBS([scan_scaled], [util bsd]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1328 | AC_SEARCH_LIBS([login], [util bsd]) |
| 1329 | AC_SEARCH_LIBS([logout], [util bsd]) |
| 1330 | AC_SEARCH_LIBS([logwtmp], [util bsd]) |
| 1331 | AC_SEARCH_LIBS([openpty], [util bsd]) |
| 1332 | AC_SEARCH_LIBS([updwtmp], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1333 | AC_CHECK_FUNCS([fmt_scaled scan_scaled login logout openpty updwtmp logwtmp]) |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1334 | |
Darren Tucker | 2fee909 | 2016-02-17 09:48:15 +1100 | [diff] [blame] | 1335 | # On some platforms, inet_ntop and gethostbyname may be found in libresolv |
| 1336 | # or libnsl. |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1337 | AC_SEARCH_LIBS([inet_ntop], [resolv nsl]) |
Darren Tucker | 2fee909 | 2016-02-17 09:48:15 +1100 | [diff] [blame] | 1338 | AC_SEARCH_LIBS([gethostbyname], [resolv nsl]) |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1339 | |
Darren Tucker | 74c1c36 | 2017-09-27 07:44:41 +1000 | [diff] [blame] | 1340 | # "Particular Function Checks" |
| 1341 | # see https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Functions.html |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 1342 | AC_FUNC_STRFTIME |
Darren Tucker | 74c1c36 | 2017-09-27 07:44:41 +1000 | [diff] [blame] | 1343 | AC_FUNC_MALLOC |
| 1344 | AC_FUNC_REALLOC |
| 1345 | # autoconf doesn't have AC_FUNC_CALLOC so fake it if malloc returns NULL; |
| 1346 | if test "x$ac_cv_func_malloc_0_nonnull" != "xyes"; then |
| 1347 | AC_DEFINE(HAVE_CALLOC, 0, [calloc(x, 0) returns NULL]) |
| 1348 | AC_DEFINE(calloc, rpl_calloc, |
| 1349 | [Define to rpl_calloc if the replacement function should be used.]) |
| 1350 | fi |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 1351 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1352 | # Check for ALTDIRFUNC glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1353 | AC_MSG_CHECKING([for GLOB_ALTDIRFUNC support]) |
| 1354 | AC_EGREP_CPP([FOUNDIT], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1355 | [ |
| 1356 | #include <glob.h> |
| 1357 | #ifdef GLOB_ALTDIRFUNC |
| 1358 | FOUNDIT |
| 1359 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1360 | ], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1361 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1362 | AC_DEFINE([GLOB_HAS_ALTDIRFUNC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1363 | [Define if your system glob() function has |
| 1364 | the GLOB_ALTDIRFUNC extension]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1365 | AC_MSG_RESULT([yes]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1366 | ], |
| 1367 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1368 | AC_MSG_RESULT([no]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1369 | ] |
| 1370 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1371 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1372 | # Check for g.gl_matchc glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1373 | AC_MSG_CHECKING([for gl_matchc field in glob_t]) |
| 1374 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], |
| 1375 | [[ glob_t g; g.gl_matchc = 1; ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1376 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1377 | AC_DEFINE([GLOB_HAS_GL_MATCHC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1378 | [Define if your system glob() function has |
| 1379 | gl_matchc options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1380 | AC_MSG_RESULT([yes]) |
| 1381 | ], [ |
| 1382 | AC_MSG_RESULT([no]) |
| 1383 | ]) |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1384 | |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1385 | # Check for g.gl_statv glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1386 | AC_MSG_CHECKING([for gl_statv and GLOB_KEEPSTAT extensions for glob]) |
| 1387 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], [[ |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1388 | #ifndef GLOB_KEEPSTAT |
| 1389 | #error "glob does not support GLOB_KEEPSTAT extension" |
| 1390 | #endif |
| 1391 | glob_t g; |
| 1392 | g.gl_statv = NULL; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1393 | ]])], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1394 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1395 | AC_DEFINE([GLOB_HAS_GL_STATV], [1], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1396 | [Define if your system glob() function has |
| 1397 | gl_statv options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1398 | AC_MSG_RESULT([yes]) |
| 1399 | ], [ |
| 1400 | AC_MSG_RESULT([no]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1401 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1402 | ]) |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1403 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1404 | AC_CHECK_DECLS([GLOB_NOMATCH], , , [#include <glob.h>]) |
Darren Tucker | 096faec | 2006-09-01 20:29:10 +1000 | [diff] [blame] | 1405 | |
Darren Tucker | 7df91b0 | 2016-07-14 12:25:24 +1000 | [diff] [blame] | 1406 | AC_CHECK_DECL([VIS_ALL], , |
| 1407 | AC_DEFINE(BROKEN_STRNVIS, 1, [missing VIS_ALL]), [#include <vis.h>]) |
| 1408 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1409 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1410 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1411 | [AC_LANG_PROGRAM([[ |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1412 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1413 | #include <dirent.h>]], |
| 1414 | [[ |
| 1415 | struct dirent d; |
| 1416 | exit(sizeof(d.d_name)<=sizeof(char)); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1417 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1418 | [AC_MSG_RESULT([yes])], |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1419 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1420 | AC_MSG_RESULT([no]) |
| 1421 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1], |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 1422 | [Define if your struct dirent expects you to |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1423 | allocate extra space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1424 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1425 | [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1426 | AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1427 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1428 | ] |
| 1429 | ) |
| 1430 | |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1431 | AC_MSG_CHECKING([for /proc/pid/fd directory]) |
| 1432 | if test -d "/proc/$$/fd" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1433 | AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd]) |
| 1434 | AC_MSG_RESULT([yes]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1435 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1436 | AC_MSG_RESULT([no]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1437 | fi |
| 1438 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1439 | # Check whether user wants S/Key support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1440 | SKEY_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1441 | AC_ARG_WITH([skey], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1442 | [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1443 | [ |
| 1444 | if test "x$withval" != "xno" ; then |
| 1445 | |
| 1446 | if test "x$withval" != "xyes" ; then |
| 1447 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1448 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1449 | fi |
| 1450 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1451 | AC_DEFINE([SKEY], [1], [Define if you want S/Key support]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1452 | LIBS="-lskey $LIBS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1453 | SKEY_MSG="yes" |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1454 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1455 | AC_MSG_CHECKING([for s/key support]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1456 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1457 | [AC_LANG_PROGRAM([[ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1458 | #include <stdio.h> |
| 1459 | #include <skey.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1460 | ]], [[ |
| 1461 | char *ff = skey_keyinfo(""); ff=""; |
| 1462 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1463 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1464 | [AC_MSG_RESULT([yes])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1465 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1466 | AC_MSG_RESULT([no]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1467 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 1468 | ]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1469 | AC_MSG_CHECKING([if skeychallenge takes 4 arguments]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1470 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1471 | #include <stdio.h> |
| 1472 | #include <skey.h> |
| 1473 | ]], [[ |
| 1474 | (void)skeychallenge(NULL,"name","",0); |
| 1475 | ]])], |
| 1476 | [ |
| 1477 | AC_MSG_RESULT([yes]) |
| 1478 | AC_DEFINE([SKEYCHALLENGE_4ARG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1479 | [Define if your skeychallenge() |
| 1480 | function takes 4 arguments (NetBSD)])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1481 | [ |
| 1482 | AC_MSG_RESULT([no]) |
| 1483 | ]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1484 | fi |
| 1485 | ] |
| 1486 | ) |
| 1487 | |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1488 | # Check whether user wants to use ldns |
| 1489 | LDNS_MSG="no" |
| 1490 | AC_ARG_WITH(ldns, |
| 1491 | [ --with-ldns[[=PATH]] Use ldns for DNSSEC support (optionally in PATH)], |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1492 | [ |
| 1493 | ldns="" |
| 1494 | if test "x$withval" = "xyes" ; then |
| 1495 | AC_PATH_TOOL([LDNSCONFIG], [ldns-config], [no]) |
| 1496 | if test "x$PKGCONFIG" = "xno"; then |
| 1497 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1498 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1499 | LIBS="-lldns $LIBS" |
| 1500 | ldns=yes |
| 1501 | else |
| 1502 | LIBS="$LIBS `$LDNSCONFIG --libs`" |
| 1503 | CPPFLAGS="$CPPFLAGS `$LDNSCONFIG --cflags`" |
Darren Tucker | 7af27bf | 2017-03-24 09:44:56 +1100 | [diff] [blame] | 1504 | ldns=yes |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1505 | fi |
| 1506 | elif test "x$withval" != "xno" ; then |
| 1507 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1508 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1509 | LIBS="-lldns $LIBS" |
| 1510 | ldns=yes |
| 1511 | fi |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1512 | |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1513 | # Verify that it works. |
| 1514 | if test "x$ldns" = "xyes" ; then |
| 1515 | AC_DEFINE(HAVE_LDNS, 1, [Define if you want ldns support]) |
| 1516 | LDNS_MSG="yes" |
| 1517 | AC_MSG_CHECKING([for ldns support]) |
| 1518 | AC_LINK_IFELSE( |
| 1519 | [AC_LANG_SOURCE([[ |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1520 | #include <stdio.h> |
| 1521 | #include <stdlib.h> |
| 1522 | #include <stdint.h> |
| 1523 | #include <ldns/ldns.h> |
| 1524 | 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] | 1525 | ]]) |
| 1526 | ], |
| 1527 | [AC_MSG_RESULT(yes)], |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1528 | [ |
| 1529 | AC_MSG_RESULT(no) |
| 1530 | AC_MSG_ERROR([** Incomplete or missing ldns libraries.]) |
| 1531 | ]) |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1532 | fi |
| 1533 | ]) |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1534 | |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1535 | # Check whether user wants libedit support |
| 1536 | LIBEDIT_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1537 | AC_ARG_WITH([libedit], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1538 | [ --with-libedit[[=PATH]] Enable libedit support for sftp], |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1539 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1540 | if test "x$withval" = "xyes" ; then |
Darren Tucker | 5935389 | 2012-05-19 15:24:37 +1000 | [diff] [blame] | 1541 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1542 | if test "x$PKGCONFIG" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1543 | AC_MSG_CHECKING([if $PKGCONFIG knows about libedit]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1544 | if "$PKGCONFIG" libedit; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1545 | AC_MSG_RESULT([yes]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1546 | use_pkgconfig_for_libedit=yes |
| 1547 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1548 | AC_MSG_RESULT([no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1549 | fi |
| 1550 | fi |
| 1551 | else |
Darren Tucker | c373a56 | 2005-09-22 20:15:08 +1000 | [diff] [blame] | 1552 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1553 | if test -n "${need_dash_r}"; then |
| 1554 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 1555 | else |
| 1556 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 1557 | fi |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1558 | fi |
Damien Miller | 1f78980 | 2010-10-11 22:35:22 +1100 | [diff] [blame] | 1559 | if test "x$use_pkgconfig_for_libedit" = "xyes"; then |
Darren Tucker | 8369c8e | 2013-12-05 11:00:16 +1100 | [diff] [blame] | 1560 | LIBEDIT=`$PKGCONFIG --libs libedit` |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1561 | CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" |
| 1562 | else |
| 1563 | LIBEDIT="-ledit -lcurses" |
| 1564 | fi |
| 1565 | OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1566 | AC_CHECK_LIB([edit], [el_init], |
| 1567 | [ AC_DEFINE([USE_LIBEDIT], [1], [Use libedit for sftp]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1568 | LIBEDIT_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1569 | AC_SUBST([LIBEDIT]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1570 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1571 | [ AC_MSG_ERROR([libedit not found]) ], |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1572 | [ $OTHERLIBS ] |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1573 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1574 | AC_MSG_CHECKING([if libedit version is compatible]) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1575 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1576 | [AC_LANG_PROGRAM([[ #include <histedit.h> ]], |
| 1577 | [[ |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1578 | int i = H_SETSIZE; |
| 1579 | el_init("", NULL, NULL, NULL); |
| 1580 | exit(0); |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1581 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1582 | [ AC_MSG_RESULT([yes]) ], |
| 1583 | [ AC_MSG_RESULT([no]) |
| 1584 | AC_MSG_ERROR([libedit version is not compatible]) ] |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1585 | ) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1586 | fi ] |
| 1587 | ) |
| 1588 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1589 | AUDIT_MODULE=none |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1590 | AC_ARG_WITH([audit], |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1591 | [ --with-audit=module Enable audit support (modules=debug,bsm,linux)], |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1592 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1593 | AC_MSG_CHECKING([for supported audit module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1594 | case "$withval" in |
| 1595 | bsm) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1596 | AC_MSG_RESULT([bsm]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1597 | AUDIT_MODULE=bsm |
| 1598 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1599 | AC_CHECK_HEADERS([bsm/audit.h], [], |
| 1600 | [AC_MSG_ERROR([BSM enabled and bsm/audit.h not found])], |
Darren Tucker | 6d0d6fb | 2006-09-09 01:05:21 +1000 | [diff] [blame] | 1601 | [ |
| 1602 | #ifdef HAVE_TIME_H |
| 1603 | # include <time.h> |
| 1604 | #endif |
| 1605 | ] |
| 1606 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1607 | AC_CHECK_LIB([bsm], [getaudit], [], |
| 1608 | [AC_MSG_ERROR([BSM enabled and required library not found])]) |
| 1609 | AC_CHECK_FUNCS([getaudit], [], |
| 1610 | [AC_MSG_ERROR([BSM enabled and required function not found])]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1611 | # These are optional |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1612 | AC_CHECK_FUNCS([getaudit_addr aug_get_machine]) |
| 1613 | AC_DEFINE([USE_BSM_AUDIT], [1], [Use BSM audit module]) |
Darren Tucker | 1fcec9d | 2013-12-19 11:00:12 +1100 | [diff] [blame] | 1614 | if test "$sol2ver" -ge 11; then |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1615 | SSHDLIBS="$SSHDLIBS -lscf" |
| 1616 | AC_DEFINE([BROKEN_BSM_API], [1], |
| 1617 | [The system has incomplete BSM API]) |
Darren Tucker | 93a2d41 | 2012-02-24 10:40:41 +1100 | [diff] [blame] | 1618 | fi |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1619 | ;; |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1620 | linux) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1621 | AC_MSG_RESULT([linux]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1622 | AUDIT_MODULE=linux |
| 1623 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1624 | AC_CHECK_HEADERS([libaudit.h]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1625 | SSHDLIBS="$SSHDLIBS -laudit" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1626 | AC_DEFINE([USE_LINUX_AUDIT], [1], [Use Linux audit module]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1627 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1628 | debug) |
| 1629 | AUDIT_MODULE=debug |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1630 | AC_MSG_RESULT([debug]) |
| 1631 | AC_DEFINE([SSH_AUDIT_EVENTS], [1], [Use audit debugging module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1632 | ;; |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1633 | no) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1634 | AC_MSG_RESULT([no]) |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1635 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1636 | *) |
| 1637 | AC_MSG_ERROR([Unknown audit module $withval]) |
| 1638 | ;; |
| 1639 | esac ] |
| 1640 | ) |
| 1641 | |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1642 | AC_ARG_WITH([pie], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 1643 | [ --with-pie Build Position Independent Executables if possible], [ |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1644 | if test "x$withval" = "xno"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1645 | use_pie=no |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1646 | fi |
| 1647 | if test "x$withval" = "xyes"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1648 | use_pie=yes |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1649 | fi |
| 1650 | ] |
| 1651 | ) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1652 | if test "x$use_pie" = "x"; then |
| 1653 | use_pie=no |
| 1654 | fi |
| 1655 | if test "x$use_toolchain_hardening" != "x1" && test "x$use_pie" = "xauto"; then |
| 1656 | # Turn off automatic PIE when toolchain hardening is off. |
| 1657 | use_pie=no |
| 1658 | fi |
Damien Miller | c161fc9 | 2014-01-29 21:01:33 +1100 | [diff] [blame] | 1659 | if test "x$use_pie" = "xauto"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1660 | # Automatic PIE requires gcc >= 4.x |
| 1661 | AC_MSG_CHECKING([for gcc >= 4.x]) |
| 1662 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
| 1663 | #if !defined(__GNUC__) || __GNUC__ < 4 |
| 1664 | #error gcc is too old |
| 1665 | #endif |
| 1666 | ]])], |
| 1667 | [ AC_MSG_RESULT([yes]) ], |
| 1668 | [ AC_MSG_RESULT([no]) |
| 1669 | use_pie=no ] |
| 1670 | ) |
| 1671 | fi |
| 1672 | if test "x$use_pie" != "xno"; then |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1673 | SAVED_CFLAGS="$CFLAGS" |
| 1674 | SAVED_LDFLAGS="$LDFLAGS" |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1675 | OSSH_CHECK_CFLAG_COMPILE([-fPIE]) |
| 1676 | OSSH_CHECK_LDFLAG_LINK([-pie]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1677 | # We use both -fPIE and -pie or neither. |
| 1678 | AC_MSG_CHECKING([whether both -fPIE and -pie are supported]) |
| 1679 | if echo "x $CFLAGS" | grep ' -fPIE' >/dev/null 2>&1 && \ |
| 1680 | echo "x $LDFLAGS" | grep ' -pie' >/dev/null 2>&1 ; then |
| 1681 | AC_MSG_RESULT([yes]) |
| 1682 | else |
| 1683 | AC_MSG_RESULT([no]) |
| 1684 | CFLAGS="$SAVED_CFLAGS" |
| 1685 | LDFLAGS="$SAVED_LDFLAGS" |
| 1686 | fi |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1687 | fi |
| 1688 | |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1689 | dnl Checks for library functions. Please keep in alphabetical order |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1690 | AC_CHECK_FUNCS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1691 | Blowfish_initstate \ |
| 1692 | Blowfish_expandstate \ |
| 1693 | Blowfish_expand0state \ |
| 1694 | Blowfish_stream2word \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1695 | asprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1696 | b64_ntop \ |
| 1697 | __b64_ntop \ |
| 1698 | b64_pton \ |
| 1699 | __b64_pton \ |
| 1700 | bcopy \ |
Damien Miller | a913442 | 2013-12-07 11:35:36 +1100 | [diff] [blame] | 1701 | bcrypt_pbkdf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1702 | bindresvport_sa \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1703 | blf_enc \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 1704 | cap_rights_limit \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1705 | clock \ |
| 1706 | closefrom \ |
| 1707 | dirfd \ |
Darren Tucker | efdf534 | 2013-05-30 08:29:08 +1000 | [diff] [blame] | 1708 | endgrent \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 1709 | err \ |
| 1710 | errx \ |
Damien Miller | 1d2c456 | 2014-02-04 11:18:20 +1100 | [diff] [blame] | 1711 | explicit_bzero \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1712 | fchmod \ |
| 1713 | fchown \ |
| 1714 | freeaddrinfo \ |
Damien Miller | b795691 | 2017-09-19 12:29:23 +1000 | [diff] [blame] | 1715 | freezero \ |
Darren Tucker | a5cf1e2 | 2014-01-17 18:10:58 +1100 | [diff] [blame] | 1716 | fstatfs \ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 1717 | fstatvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1718 | futimes \ |
| 1719 | getaddrinfo \ |
| 1720 | getcwd \ |
| 1721 | getgrouplist \ |
| 1722 | getnameinfo \ |
| 1723 | getopt \ |
Damien Miller | 151c6e4 | 2017-06-01 15:25:13 +1000 | [diff] [blame] | 1724 | getpagesize \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1725 | getpeereid \ |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1726 | getpeerucred \ |
Darren Tucker | 3c4a24c | 2013-02-15 11:41:35 +1100 | [diff] [blame] | 1727 | getpgid \ |
| 1728 | getpgrp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1729 | _getpty \ |
| 1730 | getrlimit \ |
| 1731 | getttyent \ |
| 1732 | glob \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1733 | group_from_gid \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1734 | inet_aton \ |
| 1735 | inet_ntoa \ |
| 1736 | inet_ntop \ |
| 1737 | innetgr \ |
Darren Tucker | d38f05d | 2017-03-20 13:38:27 +1100 | [diff] [blame] | 1738 | llabs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1739 | login_getcapbool \ |
| 1740 | md5_crypt \ |
| 1741 | memmove \ |
Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 1742 | memset_s \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1743 | mkdtemp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1744 | ngetaddrinfo \ |
| 1745 | nsleep \ |
| 1746 | ogetaddrinfo \ |
| 1747 | openlog_r \ |
Darren Tucker | 3ddd15e | 2015-11-30 07:23:53 +1100 | [diff] [blame] | 1748 | pledge \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 1749 | poll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1750 | prctl \ |
| 1751 | pstat \ |
| 1752 | readpassphrase \ |
Darren Tucker | 642652d | 2014-12-10 01:32:23 +1100 | [diff] [blame] | 1753 | reallocarray \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1754 | recvmsg \ |
Damien Miller | 151c6e4 | 2017-06-01 15:25:13 +1000 | [diff] [blame] | 1755 | recallocarray \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1756 | rresvport_af \ |
| 1757 | sendmsg \ |
| 1758 | setdtablesize \ |
| 1759 | setegid \ |
| 1760 | setenv \ |
| 1761 | seteuid \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1762 | setgroupent \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1763 | setgroups \ |
Darren Tucker | 34f702a | 2012-07-04 08:50:09 +1000 | [diff] [blame] | 1764 | setlinebuf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1765 | setlogin \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1766 | setpassent\ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1767 | setpcred \ |
| 1768 | setproctitle \ |
| 1769 | setregid \ |
| 1770 | setreuid \ |
| 1771 | setrlimit \ |
| 1772 | setsid \ |
| 1773 | setvbuf \ |
| 1774 | sigaction \ |
| 1775 | sigvec \ |
| 1776 | snprintf \ |
| 1777 | socketpair \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 1778 | statfs \ |
| 1779 | statvfs \ |
Darren Tucker | afec077 | 2016-12-13 10:23:03 +1100 | [diff] [blame] | 1780 | strcasestr \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1781 | strdup \ |
| 1782 | strerror \ |
| 1783 | strlcat \ |
| 1784 | strlcpy \ |
| 1785 | strmode \ |
Darren Tucker | b54f50e | 2011-09-29 23:17:18 +1000 | [diff] [blame] | 1786 | strnlen \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1787 | strnvis \ |
Darren Tucker | aa74f67 | 2010-08-16 13:15:23 +1000 | [diff] [blame] | 1788 | strptime \ |
Darren Tucker | 44fc334 | 2017-09-25 09:48:10 +1000 | [diff] [blame] | 1789 | strsignal \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1790 | strtonum \ |
Darren Tucker | 81eb5d5 | 2005-06-01 21:39:33 +1000 | [diff] [blame] | 1791 | strtoll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1792 | strtoul \ |
Darren Tucker | 8e6fb78 | 2013-02-15 12:13:01 +1100 | [diff] [blame] | 1793 | strtoull \ |
Damien Miller | 34a1769 | 2007-06-11 14:15:42 +1000 | [diff] [blame] | 1794 | swap32 \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1795 | sysconf \ |
| 1796 | tcgetpgrp \ |
Damien Miller | aa18063 | 2010-10-07 21:25:27 +1100 | [diff] [blame] | 1797 | timingsafe_bcmp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1798 | truncate \ |
| 1799 | unsetenv \ |
| 1800 | updwtmpx \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1801 | user_from_uid \ |
Damien Miller | f4db77d | 2013-03-15 10:34:25 +1100 | [diff] [blame] | 1802 | usleep \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1803 | vasprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1804 | vsnprintf \ |
| 1805 | waitpid \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 1806 | warn \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1807 | ]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1808 | |
Darren Tucker | c61d5ec | 2017-02-03 14:10:34 +1100 | [diff] [blame] | 1809 | dnl Wide character support. |
Darren Tucker | a233358 | 2016-07-14 10:59:09 +1000 | [diff] [blame] | 1810 | AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) |
Darren Tucker | a233358 | 2016-07-14 10:59:09 +1000 | [diff] [blame] | 1811 | |
Darren Tucker | 10e290e | 2016-12-13 13:51:32 +1100 | [diff] [blame] | 1812 | TEST_SSH_UTF8=${TEST_SSH_UTF8:=yes} |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 1813 | AC_MSG_CHECKING([for utf8 locale support]) |
| 1814 | AC_RUN_IFELSE( |
| 1815 | [AC_LANG_PROGRAM([[ |
| 1816 | #include <locale.h> |
Darren Tucker | c359950 | 2016-12-09 12:52:02 +1100 | [diff] [blame] | 1817 | #include <stdlib.h> |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 1818 | ]], [[ |
| 1819 | char *loc = setlocale(LC_CTYPE, "en_US.UTF-8"); |
| 1820 | if (loc != NULL) |
| 1821 | exit(0); |
| 1822 | exit(1); |
| 1823 | ]])], |
| 1824 | AC_MSG_RESULT(yes), |
| 1825 | [AC_MSG_RESULT(no) |
| 1826 | TEST_SSH_UTF8=no], |
| 1827 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 1828 | ) |
| 1829 | |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1830 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1831 | [AC_LANG_PROGRAM( |
| 1832 | [[ #include <ctype.h> ]], |
| 1833 | [[ return (isblank('a')); ]])], |
| 1834 | [AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).]) |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1835 | ]) |
| 1836 | |
Damien Miller | 5fbe93f | 2016-07-15 13:54:31 +1000 | [diff] [blame] | 1837 | disable_pkcs11= |
| 1838 | AC_ARG_ENABLE([pkcs11], |
| 1839 | [ --disable-pkcs11 disable PKCS#11 support code [no]], |
| 1840 | [ |
| 1841 | if test "x$enableval" = "xno" ; then |
| 1842 | disable_pkcs11=1 |
| 1843 | fi |
| 1844 | ] |
| 1845 | ) |
| 1846 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1847 | # PKCS11 depends on OpenSSL. |
Damien Miller | 5fbe93f | 2016-07-15 13:54:31 +1000 | [diff] [blame] | 1848 | if test "x$openssl" = "xyes" && test "x$disable_pkcs11" = "x"; then |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1849 | # PKCS#11 support requires dlopen() and co |
| 1850 | AC_SEARCH_LIBS([dlopen], [dl], |
| 1851 | [AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])] |
| 1852 | ) |
| 1853 | fi |
Damien Miller | b3c9f78 | 2010-02-12 10:11:34 +1100 | [diff] [blame] | 1854 | |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1855 | # IRIX has a const char return value for gai_strerror() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1856 | AC_CHECK_FUNCS([gai_strerror], [ |
| 1857 | AC_DEFINE([HAVE_GAI_STRERROR]) |
| 1858 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1859 | #include <sys/types.h> |
| 1860 | #include <sys/socket.h> |
| 1861 | #include <netdb.h> |
| 1862 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1863 | const char *gai_strerror(int); |
| 1864 | ]], [[ |
| 1865 | char *str; |
| 1866 | str = gai_strerror(0); |
| 1867 | ]])], [ |
| 1868 | AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1], |
| 1869 | [Define if gai_strerror() returns const char *])], [])]) |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1870 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1871 | AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], |
| 1872 | [Some systems put nanosleep outside of libc])]) |
Damien Miller | cd6853c | 2003-01-28 11:33:42 +1100 | [diff] [blame] | 1873 | |
Darren Tucker | a710891 | 2013-06-02 08:18:31 +1000 | [diff] [blame] | 1874 | AC_SEARCH_LIBS([clock_gettime], [rt], |
| 1875 | [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) |
| 1876 | |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1877 | dnl Make sure prototypes are defined for these before using them. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1878 | AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])]) |
| 1879 | AC_CHECK_DECL([strsep], |
| 1880 | [AC_CHECK_FUNCS([strsep])], |
Darren Tucker | 390b6d5 | 2005-05-28 16:54:36 +1000 | [diff] [blame] | 1881 | [], |
| 1882 | [ |
| 1883 | #ifdef HAVE_STRING_H |
| 1884 | # include <string.h> |
| 1885 | #endif |
| 1886 | ]) |
Ben Lindstrom | 3e00647 | 2002-10-16 00:24:03 +0000 | [diff] [blame] | 1887 | |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1888 | dnl tcsendbreak might be a macro |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1889 | AC_CHECK_DECL([tcsendbreak], |
| 1890 | [AC_DEFINE([HAVE_TCSENDBREAK])], |
| 1891 | [AC_CHECK_FUNCS([tcsendbreak])], |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1892 | [#include <termios.h>] |
| 1893 | ) |
| 1894 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1895 | AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>]) |
Darren Tucker | 5bb1400 | 2004-04-23 18:53:10 +1000 | [diff] [blame] | 1896 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1897 | AC_CHECK_DECLS([SHUT_RD], , , |
Darren Tucker | 128a089 | 2006-07-12 19:02:56 +1000 | [diff] [blame] | 1898 | [ |
| 1899 | #include <sys/types.h> |
| 1900 | #include <sys/socket.h> |
| 1901 | ]) |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1902 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1903 | AC_CHECK_DECLS([O_NONBLOCK], , , |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1904 | [ |
| 1905 | #include <sys/types.h> |
| 1906 | #ifdef HAVE_SYS_STAT_H |
| 1907 | # include <sys/stat.h> |
| 1908 | #endif |
| 1909 | #ifdef HAVE_FCNTL_H |
| 1910 | # include <fcntl.h> |
| 1911 | #endif |
| 1912 | ]) |
| 1913 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1914 | AC_CHECK_DECLS([writev], , , [ |
Darren Tucker | ed0b592 | 2006-09-03 22:44:49 +1000 | [diff] [blame] | 1915 | #include <sys/types.h> |
| 1916 | #include <sys/uio.h> |
| 1917 | #include <unistd.h> |
| 1918 | ]) |
| 1919 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1920 | AC_CHECK_DECLS([MAXSYMLINKS], , , [ |
Darren Tucker | 6d862a5 | 2007-04-29 14:39:02 +1000 | [diff] [blame] | 1921 | #include <sys/param.h> |
| 1922 | ]) |
| 1923 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1924 | AC_CHECK_DECLS([offsetof], , , [ |
Darren Tucker | dca0edf | 2007-04-29 15:06:44 +1000 | [diff] [blame] | 1925 | #include <stddef.h> |
| 1926 | ]) |
| 1927 | |
Darren Tucker | c7aad00 | 2013-06-02 07:18:47 +1000 | [diff] [blame] | 1928 | # extra bits for select(2) |
| 1929 | AC_CHECK_DECLS([howmany, NFDBITS], [], [], [[ |
| 1930 | #include <sys/param.h> |
| 1931 | #include <sys/types.h> |
| 1932 | #ifdef HAVE_SYS_SYSMACROS_H |
| 1933 | #include <sys/sysmacros.h> |
| 1934 | #endif |
| 1935 | #ifdef HAVE_SYS_SELECT_H |
| 1936 | #include <sys/select.h> |
| 1937 | #endif |
| 1938 | #ifdef HAVE_SYS_TIME_H |
| 1939 | #include <sys/time.h> |
| 1940 | #endif |
| 1941 | #ifdef HAVE_UNISTD_H |
| 1942 | #include <unistd.h> |
| 1943 | #endif |
| 1944 | ]]) |
| 1945 | AC_CHECK_TYPES([fd_mask], [], [], [[ |
| 1946 | #include <sys/param.h> |
| 1947 | #include <sys/types.h> |
| 1948 | #ifdef HAVE_SYS_SELECT_H |
| 1949 | #include <sys/select.h> |
| 1950 | #endif |
| 1951 | #ifdef HAVE_SYS_TIME_H |
| 1952 | #include <sys/time.h> |
| 1953 | #endif |
| 1954 | #ifdef HAVE_UNISTD_H |
| 1955 | #include <unistd.h> |
| 1956 | #endif |
| 1957 | ]]) |
| 1958 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1959 | AC_CHECK_FUNCS([setresuid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1960 | dnl Some platorms have setresuid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1961 | AC_MSG_CHECKING([if setresuid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1962 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1963 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1964 | #include <stdlib.h> |
| 1965 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1966 | ]], [[ |
| 1967 | errno=0; |
| 1968 | setresuid(0,0,0); |
| 1969 | if (errno==ENOSYS) |
| 1970 | exit(1); |
| 1971 | else |
| 1972 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1973 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1974 | [AC_MSG_RESULT([yes])], |
| 1975 | [AC_DEFINE([BROKEN_SETRESUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1976 | [Define if your setresuid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1977 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1978 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1979 | ) |
| 1980 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1981 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1982 | AC_CHECK_FUNCS([setresgid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1983 | dnl Some platorms have setresgid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1984 | AC_MSG_CHECKING([if setresgid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1985 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1986 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1987 | #include <stdlib.h> |
| 1988 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1989 | ]], [[ |
| 1990 | errno=0; |
| 1991 | setresgid(0,0,0); |
| 1992 | if (errno==ENOSYS) |
| 1993 | exit(1); |
| 1994 | else |
| 1995 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1996 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1997 | [AC_MSG_RESULT([yes])], |
| 1998 | [AC_DEFINE([BROKEN_SETRESGID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1999 | [Define if your setresgid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2000 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2001 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 2002 | ) |
| 2003 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 2004 | |
Darren Tucker | d3e2aee | 2015-07-17 12:52:34 +1000 | [diff] [blame] | 2005 | AC_CHECK_FUNCS([realpath], [ |
| 2006 | dnl the sftp v3 spec says SSH_FXP_REALPATH will "canonicalize any given |
| 2007 | dnl path name", however some implementations of realpath (and some |
| 2008 | dnl versions of the POSIX spec) do not work on non-existent files, |
| 2009 | dnl so we use the OpenBSD implementation on those platforms. |
| 2010 | AC_MSG_CHECKING([if realpath works with non-existent files]) |
| 2011 | AC_RUN_IFELSE( |
| 2012 | [AC_LANG_PROGRAM([[ |
| 2013 | #include <limits.h> |
| 2014 | #include <stdlib.h> |
| 2015 | #include <errno.h> |
| 2016 | ]], [[ |
| 2017 | char buf[PATH_MAX]; |
| 2018 | if (realpath("/opensshnonexistentfilename1234", buf) == NULL) |
| 2019 | if (errno == ENOENT) |
| 2020 | exit(1); |
| 2021 | exit(0); |
| 2022 | ]])], |
| 2023 | [AC_MSG_RESULT([yes])], |
| 2024 | [AC_DEFINE([BROKEN_REALPATH], [1], |
| 2025 | [realpath does not work with nonexistent files]) |
| 2026 | AC_MSG_RESULT([no])], |
| 2027 | [AC_MSG_WARN([cross compiling: assuming working])] |
| 2028 | ) |
| 2029 | ]) |
| 2030 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2031 | dnl Checks for time functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2032 | AC_CHECK_FUNCS([gettimeofday time]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2033 | dnl Checks for utmp functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2034 | AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent]) |
| 2035 | AC_CHECK_FUNCS([utmpname]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2036 | dnl Checks for utmpx functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2037 | AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline getutxuser pututxline]) |
| 2038 | AC_CHECK_FUNCS([setutxdb setutxent utmpxname]) |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 2039 | dnl Checks for lastlog functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2040 | AC_CHECK_FUNCS([getlastlogxbyname]) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 2041 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2042 | AC_CHECK_FUNC([daemon], |
| 2043 | [AC_DEFINE([HAVE_DAEMON], [1], [Define if your libraries define daemon()])], |
| 2044 | [AC_CHECK_LIB([bsd], [daemon], |
| 2045 | [LIBS="$LIBS -lbsd"; AC_DEFINE([HAVE_DAEMON])])] |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 2046 | ) |
| 2047 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2048 | AC_CHECK_FUNC([getpagesize], |
| 2049 | [AC_DEFINE([HAVE_GETPAGESIZE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2050 | [Define if your libraries define getpagesize()])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2051 | [AC_CHECK_LIB([ucb], [getpagesize], |
| 2052 | [LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])] |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 2053 | ) |
| 2054 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2055 | # Check for broken snprintf |
| 2056 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 2057 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2058 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2059 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 2060 | [[ |
| 2061 | char b[5]; |
| 2062 | snprintf(b,5,"123456789"); |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 2063 | exit(b[4]!='\0'); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2064 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2065 | [AC_MSG_RESULT([yes])], |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2066 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2067 | AC_MSG_RESULT([no]) |
| 2068 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2069 | [Define if your snprintf is busted]) |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2070 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2071 | ], |
| 2072 | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2073 | ) |
| 2074 | fi |
| 2075 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2076 | # We depend on vsnprintf returning the right thing on overflow: the |
| 2077 | # number of characters it tried to create (as per SUSv3) |
| 2078 | if test "x$ac_cv_func_vsnprintf" = "xyes" ; then |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2079 | AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) |
| 2080 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2081 | [AC_LANG_PROGRAM([[ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2082 | #include <sys/types.h> |
| 2083 | #include <stdio.h> |
| 2084 | #include <stdarg.h> |
| 2085 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2086 | int x_snprintf(char *str, size_t count, const char *fmt, ...) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2087 | { |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2088 | size_t ret; |
| 2089 | va_list ap; |
| 2090 | |
| 2091 | va_start(ap, fmt); |
| 2092 | ret = vsnprintf(str, count, fmt, ap); |
| 2093 | va_end(ap); |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2094 | return ret; |
| 2095 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2096 | ]], [[ |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2097 | char x[1]; |
| 2098 | if (x_snprintf(x, 1, "%s %d", "hello", 12345) != 11) |
| 2099 | return 1; |
| 2100 | if (x_snprintf(NULL, 0, "%s %d", "hello", 12345) != 11) |
| 2101 | return 1; |
| 2102 | return 0; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2103 | ]])], |
| 2104 | [AC_MSG_RESULT([yes])], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2105 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2106 | AC_MSG_RESULT([no]) |
| 2107 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2108 | [Define if your snprintf is busted]) |
| 2109 | AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor]) |
| 2110 | ], |
| 2111 | [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ] |
| 2112 | ) |
| 2113 | fi |
| 2114 | |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2115 | # On systems where [v]snprintf is broken, but is declared in stdio, |
| 2116 | # check that the fmt argument is const char * or just char *. |
| 2117 | # This is only useful for when BROKEN_SNPRINTF |
| 2118 | AC_MSG_CHECKING([whether snprintf can declare const char *fmt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2119 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2120 | #include <stdio.h> |
| 2121 | int snprintf(char *a, size_t b, const char *c, ...) { return 0; } |
| 2122 | ]], [[ |
| 2123 | snprintf(0, 0, 0); |
| 2124 | ]])], |
| 2125 | [AC_MSG_RESULT([yes]) |
| 2126 | AC_DEFINE([SNPRINTF_CONST], [const], |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2127 | [Define as const if snprintf() can declare const char *fmt])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2128 | [AC_MSG_RESULT([no]) |
| 2129 | AC_DEFINE([SNPRINTF_CONST], [/* not const */])]) |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2130 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 2131 | # Check for missing getpeereid (or equiv) support |
| 2132 | NO_PEERCHECK="" |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 2133 | 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] | 2134 | AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2135 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2136 | #include <sys/types.h> |
| 2137 | #include <sys/socket.h>]], [[int i = SO_PEERCRED;]])], |
| 2138 | [ AC_MSG_RESULT([yes]) |
| 2139 | AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have PEERCRED socket option]) |
| 2140 | ], [AC_MSG_RESULT([no]) |
| 2141 | NO_PEERCHECK=1 |
| 2142 | ]) |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 2143 | fi |
| 2144 | |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2145 | dnl see whether mkstemp() requires XXXXXX |
| 2146 | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then |
| 2147 | AC_MSG_CHECKING([for (overly) strict mkstemp]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2148 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2149 | [AC_LANG_PROGRAM([[ |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2150 | #include <stdlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2151 | ]], [[ |
| 2152 | char template[]="conftest.mkstemp-test"; |
| 2153 | if (mkstemp(template) == -1) |
| 2154 | exit(1); |
| 2155 | unlink(template); |
| 2156 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2157 | ]])], |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2158 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2159 | AC_MSG_RESULT([no]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2160 | ], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2161 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2162 | AC_MSG_RESULT([yes]) |
| 2163 | AC_DEFINE([HAVE_STRICT_MKSTEMP], [1], [Silly mkstemp()]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2164 | ], |
| 2165 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2166 | AC_MSG_RESULT([yes]) |
| 2167 | AC_DEFINE([HAVE_STRICT_MKSTEMP]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2168 | ] |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2169 | ) |
| 2170 | fi |
| 2171 | |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2172 | dnl make sure that openpty does not reacquire controlling terminal |
| 2173 | if test ! -z "$check_for_openpty_ctty_bug"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2174 | AC_MSG_CHECKING([if openpty correctly handles controlling tty]) |
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 | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2177 | #include <stdio.h> |
| 2178 | #include <sys/fcntl.h> |
| 2179 | #include <sys/types.h> |
| 2180 | #include <sys/wait.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2181 | ]], [[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2182 | pid_t pid; |
| 2183 | int fd, ptyfd, ttyfd, status; |
| 2184 | |
| 2185 | pid = fork(); |
| 2186 | if (pid < 0) { /* failed */ |
| 2187 | exit(1); |
| 2188 | } else if (pid > 0) { /* parent */ |
| 2189 | waitpid(pid, &status, 0); |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2190 | if (WIFEXITED(status)) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2191 | exit(WEXITSTATUS(status)); |
| 2192 | else |
| 2193 | exit(2); |
| 2194 | } else { /* child */ |
| 2195 | close(0); close(1); close(2); |
| 2196 | setsid(); |
| 2197 | openpty(&ptyfd, &ttyfd, NULL, NULL, NULL); |
| 2198 | fd = open("/dev/tty", O_RDWR | O_NOCTTY); |
| 2199 | if (fd >= 0) |
| 2200 | exit(3); /* Acquired ctty: broken */ |
| 2201 | else |
| 2202 | exit(0); /* Did not acquire ctty: OK */ |
| 2203 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2204 | ]])], |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2205 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2206 | AC_MSG_RESULT([yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2207 | ], |
| 2208 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2209 | AC_MSG_RESULT([no]) |
| 2210 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2211 | ], |
| 2212 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2213 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2214 | ] |
| 2215 | ) |
| 2216 | fi |
| 2217 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2218 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2219 | test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2220 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2221 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2222 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2223 | #include <stdio.h> |
| 2224 | #include <sys/socket.h> |
| 2225 | #include <netdb.h> |
| 2226 | #include <errno.h> |
| 2227 | #include <netinet/in.h> |
| 2228 | |
| 2229 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2230 | ]], [[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2231 | int err, sock; |
| 2232 | struct addrinfo *gai_ai, *ai, hints; |
| 2233 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2234 | |
| 2235 | memset(&hints, 0, sizeof(hints)); |
| 2236 | hints.ai_family = PF_UNSPEC; |
| 2237 | hints.ai_socktype = SOCK_STREAM; |
| 2238 | hints.ai_flags = AI_PASSIVE; |
| 2239 | |
| 2240 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2241 | if (err != 0) { |
| 2242 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2243 | exit(1); |
| 2244 | } |
| 2245 | |
| 2246 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2247 | if (ai->ai_family != AF_INET6) |
| 2248 | continue; |
| 2249 | |
| 2250 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2251 | sizeof(ntop), strport, sizeof(strport), |
| 2252 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2253 | |
| 2254 | if (err != 0) { |
| 2255 | if (err == EAI_SYSTEM) |
| 2256 | perror("getnameinfo EAI_SYSTEM"); |
| 2257 | else |
| 2258 | fprintf(stderr, "getnameinfo failed: %s\n", |
| 2259 | gai_strerror(err)); |
| 2260 | exit(2); |
| 2261 | } |
| 2262 | |
| 2263 | sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
| 2264 | if (sock < 0) |
| 2265 | perror("socket"); |
| 2266 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
| 2267 | if (errno == EBADF) |
| 2268 | exit(3); |
| 2269 | } |
| 2270 | } |
| 2271 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2272 | ]])], |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2273 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2274 | AC_MSG_RESULT([yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2275 | ], |
| 2276 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2277 | AC_MSG_RESULT([no]) |
| 2278 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2279 | ], |
| 2280 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2281 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2282 | ] |
| 2283 | ) |
| 2284 | fi |
| 2285 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2286 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2287 | test "x$check_for_aix_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2288 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2289 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2290 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2291 | #include <stdio.h> |
| 2292 | #include <sys/socket.h> |
| 2293 | #include <netdb.h> |
| 2294 | #include <errno.h> |
| 2295 | #include <netinet/in.h> |
| 2296 | |
| 2297 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2298 | ]], [[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2299 | int err, sock; |
| 2300 | struct addrinfo *gai_ai, *ai, hints; |
| 2301 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2302 | |
| 2303 | memset(&hints, 0, sizeof(hints)); |
| 2304 | hints.ai_family = PF_UNSPEC; |
| 2305 | hints.ai_socktype = SOCK_STREAM; |
| 2306 | hints.ai_flags = AI_PASSIVE; |
| 2307 | |
| 2308 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2309 | if (err != 0) { |
| 2310 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2311 | exit(1); |
| 2312 | } |
| 2313 | |
| 2314 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2315 | if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) |
| 2316 | continue; |
| 2317 | |
| 2318 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2319 | sizeof(ntop), strport, sizeof(strport), |
| 2320 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2321 | |
| 2322 | if (ai->ai_family == AF_INET && err != 0) { |
| 2323 | perror("getnameinfo"); |
| 2324 | exit(2); |
| 2325 | } |
| 2326 | } |
| 2327 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2328 | ]])], |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2329 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2330 | AC_MSG_RESULT([yes]) |
| 2331 | AC_DEFINE([AIX_GETNAMEINFO_HACK], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2332 | [Define if you have a getaddrinfo that fails |
| 2333 | for the all-zeros IPv6 address]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2334 | ], |
| 2335 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2336 | AC_MSG_RESULT([no]) |
| 2337 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2338 | ], |
Darren Tucker | 8b272ab | 2006-06-27 11:20:28 +1000 | [diff] [blame] | 2339 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2340 | AC_MSG_RESULT([cross-compiling, assuming no]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2341 | ] |
| 2342 | ) |
| 2343 | fi |
| 2344 | |
Darren Tucker | e50e8c9 | 2015-02-21 15:10:33 +1100 | [diff] [blame] | 2345 | if test "x$ac_cv_func_getaddrinfo" = "xyes"; then |
| 2346 | AC_CHECK_DECLS(AI_NUMERICSERV, , , |
| 2347 | [#include <sys/types.h> |
| 2348 | #include <sys/socket.h> |
| 2349 | #include <netdb.h>]) |
| 2350 | fi |
| 2351 | |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2352 | if test "x$check_for_conflicting_getspnam" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2353 | AC_MSG_CHECKING([for conflicting getspnam in shadow.h]) |
| 2354 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]], |
| 2355 | [[ exit(0); ]])], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2356 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2357 | AC_MSG_RESULT([no]) |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2358 | ], |
| 2359 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2360 | AC_MSG_RESULT([yes]) |
| 2361 | AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2362 | [Conflicting defs for getspnam]) |
| 2363 | ] |
| 2364 | ) |
| 2365 | fi |
| 2366 | |
Darren Tucker | 20e5e8b | 2016-08-02 12:16:34 +1000 | [diff] [blame] | 2367 | dnl NetBSD added an strnvis and unfortunately made it incompatible with the |
| 2368 | dnl existing one in OpenBSD and Linux's libbsd (the former having existed |
| 2369 | dnl for over ten years). Despite this incompatibility being reported during |
| 2370 | dnl development (see http://gnats.netbsd.org/44977) they still shipped it. |
| 2371 | dnl Even more unfortunately FreeBSD and later MacOS picked up this incompatible |
| 2372 | dnl implementation. Try to detect this mess, and assume the only safe option |
| 2373 | dnl if we're cross compiling. |
| 2374 | dnl |
| 2375 | dnl OpenBSD, 2001: strnvis(char *dst, const char *src, size_t dlen, int flag); |
| 2376 | dnl NetBSD: 2012, strnvis(char *dst, size_t dlen, const char *src, int flag); |
| 2377 | if test "x$ac_cv_func_strnvis" = "xyes"; then |
| 2378 | AC_MSG_CHECKING([for working strnvis]) |
| 2379 | AC_RUN_IFELSE( |
| 2380 | [AC_LANG_PROGRAM([[ |
| 2381 | #include <signal.h> |
| 2382 | #include <stdlib.h> |
| 2383 | #include <string.h> |
| 2384 | #include <vis.h> |
| 2385 | static void sighandler(int sig) { _exit(1); } |
| 2386 | ]], [[ |
| 2387 | char dst[16]; |
| 2388 | |
| 2389 | signal(SIGSEGV, sighandler); |
| 2390 | if (strnvis(dst, "src", 4, 0) && strcmp(dst, "src") == 0) |
| 2391 | exit(0); |
| 2392 | exit(1) |
| 2393 | ]])], |
| 2394 | [AC_MSG_RESULT([yes])], |
| 2395 | [AC_MSG_RESULT([no]) |
| 2396 | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis detected broken])], |
| 2397 | [AC_MSG_WARN([cross compiling: assuming broken]) |
| 2398 | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis assumed broken])] |
| 2399 | ) |
| 2400 | fi |
| 2401 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 2402 | AC_FUNC_GETPGRP |
| 2403 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2404 | # Search for OpenSSL |
| 2405 | saved_CPPFLAGS="$CPPFLAGS" |
| 2406 | saved_LDFLAGS="$LDFLAGS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2407 | AC_ARG_WITH([ssl-dir], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2408 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 2409 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2410 | if test "x$openssl" = "xno" ; then |
| 2411 | AC_MSG_ERROR([cannot use --with-ssl-dir when OpenSSL disabled]) |
| 2412 | fi |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 2413 | if test "x$withval" != "xno" ; then |
Darren Tucker | c7e38d5 | 2005-02-09 22:12:30 +1100 | [diff] [blame] | 2414 | case "$withval" in |
| 2415 | # Relative paths |
| 2416 | ./*|../*) withval="`pwd`/$withval" |
| 2417 | esac |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2418 | if test -d "$withval/lib"; then |
| 2419 | if test -n "${need_dash_r}"; then |
| 2420 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 2421 | else |
| 2422 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 2423 | fi |
Darren Tucker | 9f8703b | 2010-04-23 11:12:06 +1000 | [diff] [blame] | 2424 | elif test -d "$withval/lib64"; then |
| 2425 | if test -n "${need_dash_r}"; then |
| 2426 | LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}" |
| 2427 | else |
| 2428 | LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" |
| 2429 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2430 | else |
| 2431 | if test -n "${need_dash_r}"; then |
| 2432 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
| 2433 | else |
| 2434 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 2435 | fi |
| 2436 | fi |
| 2437 | if test -d "$withval/include"; then |
| 2438 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 2439 | else |
| 2440 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 2441 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2442 | fi |
| 2443 | ] |
| 2444 | ) |
Damien Miller | b9c5667 | 2014-05-15 14:43:37 +1000 | [diff] [blame] | 2445 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2446 | AC_ARG_WITH([openssl-header-check], |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2447 | [ --without-openssl-header-check Disable OpenSSL version consistency check], |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2448 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2449 | if test "x$withval" = "xno" ; then |
| 2450 | openssl_check_nonfatal=1 |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2451 | fi |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2452 | ] |
| 2453 | ) |
| 2454 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2455 | openssl_engine=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2456 | AC_ARG_WITH([ssl-engine], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2457 | [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2458 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2459 | if test "x$withval" != "xno" ; then |
Darren Tucker | b5fa0cd | 2015-12-15 15:10:32 +1100 | [diff] [blame] | 2460 | if test "x$openssl" = "xno" ; then |
| 2461 | AC_MSG_ERROR([cannot use --with-ssl-engine when OpenSSL disabled]) |
| 2462 | fi |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2463 | openssl_engine=yes |
| 2464 | fi |
| 2465 | ] |
| 2466 | ) |
| 2467 | |
| 2468 | if test "x$openssl" = "xyes" ; then |
| 2469 | LIBS="-lcrypto $LIBS" |
| 2470 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL], [1], |
| 2471 | [Define if your ssl headers are included |
| 2472 | with #include <openssl/header.h>])], |
| 2473 | [ |
| 2474 | dnl Check default openssl install dir |
| 2475 | if test -n "${need_dash_r}"; then |
| 2476 | LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}" |
| 2477 | else |
| 2478 | LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" |
| 2479 | fi |
| 2480 | CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" |
| 2481 | AC_CHECK_HEADER([openssl/opensslv.h], , |
| 2482 | [AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])]) |
| 2483 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL])], |
| 2484 | [ |
| 2485 | AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) |
| 2486 | ] |
| 2487 | ) |
| 2488 | ] |
| 2489 | ) |
| 2490 | |
| 2491 | # Determine OpenSSL header version |
| 2492 | AC_MSG_CHECKING([OpenSSL header version]) |
| 2493 | AC_RUN_IFELSE( |
| 2494 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 1560596 | 2015-11-10 11:14:47 +1100 | [diff] [blame] | 2495 | #include <stdlib.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2496 | #include <stdio.h> |
| 2497 | #include <string.h> |
| 2498 | #include <openssl/opensslv.h> |
| 2499 | #define DATA "conftest.sslincver" |
| 2500 | ]], [[ |
| 2501 | FILE *fd; |
| 2502 | int rc; |
| 2503 | |
| 2504 | fd = fopen(DATA,"w"); |
| 2505 | if(fd == NULL) |
| 2506 | exit(1); |
| 2507 | |
Darren Tucker | b341353 | 2016-04-04 11:09:21 +1000 | [diff] [blame] | 2508 | if ((rc = fprintf(fd, "%08lx (%s)\n", |
| 2509 | (unsigned long)OPENSSL_VERSION_NUMBER, |
| 2510 | OPENSSL_VERSION_TEXT)) < 0) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2511 | exit(1); |
| 2512 | |
| 2513 | exit(0); |
| 2514 | ]])], |
| 2515 | [ |
| 2516 | ssl_header_ver=`cat conftest.sslincver` |
| 2517 | AC_MSG_RESULT([$ssl_header_ver]) |
| 2518 | ], |
| 2519 | [ |
| 2520 | AC_MSG_RESULT([not found]) |
| 2521 | AC_MSG_ERROR([OpenSSL version header not found.]) |
| 2522 | ], |
| 2523 | [ |
| 2524 | AC_MSG_WARN([cross compiling: not checking]) |
| 2525 | ] |
| 2526 | ) |
| 2527 | |
| 2528 | # Determine OpenSSL library version |
| 2529 | AC_MSG_CHECKING([OpenSSL library version]) |
| 2530 | AC_RUN_IFELSE( |
| 2531 | [AC_LANG_PROGRAM([[ |
| 2532 | #include <stdio.h> |
| 2533 | #include <string.h> |
| 2534 | #include <openssl/opensslv.h> |
| 2535 | #include <openssl/crypto.h> |
| 2536 | #define DATA "conftest.ssllibver" |
| 2537 | ]], [[ |
| 2538 | FILE *fd; |
| 2539 | int rc; |
| 2540 | |
| 2541 | fd = fopen(DATA,"w"); |
| 2542 | if(fd == NULL) |
| 2543 | exit(1); |
| 2544 | |
Darren Tucker | 815bcac | 2016-04-04 11:07:59 +1000 | [diff] [blame] | 2545 | if ((rc = fprintf(fd, "%08lx (%s)\n", (unsigned long)SSLeay(), |
| 2546 | SSLeay_version(SSLEAY_VERSION))) < 0) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2547 | exit(1); |
| 2548 | |
| 2549 | exit(0); |
| 2550 | ]])], |
| 2551 | [ |
| 2552 | ssl_library_ver=`cat conftest.ssllibver` |
| 2553 | # Check version is supported. |
| 2554 | case "$ssl_library_ver" in |
Damien Miller | 2429cf7 | 2017-03-14 18:01:52 +1100 | [diff] [blame] | 2555 | 10000*|0*) |
| 2556 | AC_MSG_ERROR([OpenSSL >= 1.0.1 required (have "$ssl_library_ver")]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2557 | ;; |
Damien Miller | 04dc070 | 2017-09-28 14:54:34 -0700 | [diff] [blame] | 2558 | 100*) ;; # 1.0.x |
Damien Miller | bba69c2 | 2017-09-28 16:06:21 -0700 | [diff] [blame] | 2559 | 200*) ;; # LibreSSL |
Damien Miller | 04dc070 | 2017-09-28 14:54:34 -0700 | [diff] [blame] | 2560 | *) |
| 2561 | AC_MSG_ERROR([OpenSSL >= 1.1.0 is not yet supported (have "$ssl_library_ver")]) |
| 2562 | ;; |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2563 | esac |
| 2564 | AC_MSG_RESULT([$ssl_library_ver]) |
| 2565 | ], |
| 2566 | [ |
| 2567 | AC_MSG_RESULT([not found]) |
| 2568 | AC_MSG_ERROR([OpenSSL library not found.]) |
| 2569 | ], |
| 2570 | [ |
| 2571 | AC_MSG_WARN([cross compiling: not checking]) |
| 2572 | ] |
| 2573 | ) |
| 2574 | |
| 2575 | # Sanity check OpenSSL headers |
| 2576 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
| 2577 | AC_RUN_IFELSE( |
| 2578 | [AC_LANG_PROGRAM([[ |
| 2579 | #include <string.h> |
| 2580 | #include <openssl/opensslv.h> |
Darren Tucker | c1d7e54 | 2015-12-15 14:27:09 +1100 | [diff] [blame] | 2581 | #include <openssl/crypto.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2582 | ]], [[ |
| 2583 | exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); |
| 2584 | ]])], |
| 2585 | [ |
| 2586 | AC_MSG_RESULT([yes]) |
| 2587 | ], |
| 2588 | [ |
| 2589 | AC_MSG_RESULT([no]) |
| 2590 | if test "x$openssl_check_nonfatal" = "x"; then |
| 2591 | AC_MSG_ERROR([Your OpenSSL headers do not match your |
| 2592 | library. Check config.log for details. |
| 2593 | If you are sure your installation is consistent, you can disable the check |
| 2594 | by running "./configure --without-openssl-header-check". |
| 2595 | Also see contrib/findssl.sh for help identifying header/library mismatches. |
| 2596 | ]) |
| 2597 | else |
| 2598 | AC_MSG_WARN([Your OpenSSL headers do not match your |
| 2599 | library. Check config.log for details. |
| 2600 | Also see contrib/findssl.sh for help identifying header/library mismatches.]) |
| 2601 | fi |
| 2602 | ], |
| 2603 | [ |
| 2604 | AC_MSG_WARN([cross compiling: not checking]) |
| 2605 | ] |
| 2606 | ) |
| 2607 | |
| 2608 | AC_MSG_CHECKING([if programs using OpenSSL functions will link]) |
| 2609 | AC_LINK_IFELSE( |
| 2610 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2611 | [[ SSLeay_add_all_algorithms(); ]])], |
| 2612 | [ |
| 2613 | AC_MSG_RESULT([yes]) |
| 2614 | ], |
| 2615 | [ |
| 2616 | AC_MSG_RESULT([no]) |
| 2617 | saved_LIBS="$LIBS" |
| 2618 | LIBS="$LIBS -ldl" |
| 2619 | AC_MSG_CHECKING([if programs using OpenSSL need -ldl]) |
| 2620 | AC_LINK_IFELSE( |
| 2621 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2622 | [[ SSLeay_add_all_algorithms(); ]])], |
| 2623 | [ |
| 2624 | AC_MSG_RESULT([yes]) |
| 2625 | ], |
| 2626 | [ |
| 2627 | AC_MSG_RESULT([no]) |
| 2628 | LIBS="$saved_LIBS" |
| 2629 | ] |
| 2630 | ) |
| 2631 | ] |
| 2632 | ) |
| 2633 | |
| 2634 | AC_CHECK_FUNCS([ \ |
| 2635 | BN_is_prime_ex \ |
| 2636 | DSA_generate_parameters_ex \ |
| 2637 | EVP_DigestInit_ex \ |
| 2638 | EVP_DigestFinal_ex \ |
| 2639 | EVP_MD_CTX_init \ |
| 2640 | EVP_MD_CTX_cleanup \ |
| 2641 | EVP_MD_CTX_copy_ex \ |
| 2642 | HMAC_CTX_init \ |
| 2643 | RSA_generate_key_ex \ |
| 2644 | RSA_get_default_method \ |
| 2645 | ]) |
| 2646 | |
| 2647 | if test "x$openssl_engine" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2648 | AC_MSG_CHECKING([for OpenSSL ENGINE support]) |
| 2649 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2650 | #include <openssl/engine.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2651 | ]], [[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2652 | ENGINE_load_builtin_engines(); |
| 2653 | ENGINE_register_all_complete(); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2654 | ]])], |
| 2655 | [ AC_MSG_RESULT([yes]) |
| 2656 | AC_DEFINE([USE_OPENSSL_ENGINE], [1], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2657 | [Enable OpenSSL engine support]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2658 | ], [ AC_MSG_ERROR([OpenSSL ENGINE support not found]) |
| 2659 | ]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2660 | fi |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2661 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2662 | # Check for OpenSSL without EVP_aes_{192,256}_cbc |
| 2663 | AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) |
| 2664 | AC_LINK_IFELSE( |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2665 | [AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2666 | #include <string.h> |
| 2667 | #include <openssl/evp.h> |
| 2668 | ]], [[ |
| 2669 | exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL); |
| 2670 | ]])], |
| 2671 | [ |
| 2672 | AC_MSG_RESULT([no]) |
| 2673 | ], |
| 2674 | [ |
| 2675 | AC_MSG_RESULT([yes]) |
| 2676 | AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1], |
| 2677 | [libcrypto is missing AES 192 and 256 bit functions]) |
| 2678 | ] |
| 2679 | ) |
| 2680 | |
| 2681 | # Check for OpenSSL with EVP_aes_*ctr |
| 2682 | AC_MSG_CHECKING([whether OpenSSL has AES CTR via EVP]) |
| 2683 | AC_LINK_IFELSE( |
| 2684 | [AC_LANG_PROGRAM([[ |
| 2685 | #include <string.h> |
| 2686 | #include <openssl/evp.h> |
| 2687 | ]], [[ |
| 2688 | exit(EVP_aes_128_ctr() == NULL || |
| 2689 | EVP_aes_192_cbc() == NULL || |
| 2690 | EVP_aes_256_cbc() == NULL); |
| 2691 | ]])], |
| 2692 | [ |
| 2693 | AC_MSG_RESULT([yes]) |
| 2694 | AC_DEFINE([OPENSSL_HAVE_EVPCTR], [1], |
| 2695 | [libcrypto has EVP AES CTR]) |
| 2696 | ], |
| 2697 | [ |
| 2698 | AC_MSG_RESULT([no]) |
| 2699 | ] |
| 2700 | ) |
| 2701 | |
| 2702 | # Check for OpenSSL with EVP_aes_*gcm |
| 2703 | AC_MSG_CHECKING([whether OpenSSL has AES GCM via EVP]) |
| 2704 | AC_LINK_IFELSE( |
| 2705 | [AC_LANG_PROGRAM([[ |
| 2706 | #include <string.h> |
| 2707 | #include <openssl/evp.h> |
| 2708 | ]], [[ |
| 2709 | exit(EVP_aes_128_gcm() == NULL || |
| 2710 | EVP_aes_256_gcm() == NULL || |
| 2711 | EVP_CTRL_GCM_SET_IV_FIXED == 0 || |
| 2712 | EVP_CTRL_GCM_IV_GEN == 0 || |
| 2713 | EVP_CTRL_GCM_SET_TAG == 0 || |
| 2714 | EVP_CTRL_GCM_GET_TAG == 0 || |
| 2715 | EVP_CIPHER_CTX_ctrl(NULL, 0, 0, NULL) == 0); |
| 2716 | ]])], |
| 2717 | [ |
| 2718 | AC_MSG_RESULT([yes]) |
| 2719 | AC_DEFINE([OPENSSL_HAVE_EVPGCM], [1], |
| 2720 | [libcrypto has EVP AES GCM]) |
| 2721 | ], |
| 2722 | [ |
| 2723 | AC_MSG_RESULT([no]) |
| 2724 | unsupported_algorithms="$unsupported_cipers \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2725 | aes128-gcm@openssh.com \ |
| 2726 | aes256-gcm@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2727 | ] |
| 2728 | ) |
| 2729 | |
| 2730 | AC_SEARCH_LIBS([EVP_CIPHER_CTX_ctrl], [crypto], |
| 2731 | [AC_DEFINE([HAVE_EVP_CIPHER_CTX_CTRL], [1], |
| 2732 | [Define if libcrypto has EVP_CIPHER_CTX_ctrl])]) |
| 2733 | |
| 2734 | AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) |
| 2735 | AC_LINK_IFELSE( |
| 2736 | [AC_LANG_PROGRAM([[ |
| 2737 | #include <string.h> |
| 2738 | #include <openssl/evp.h> |
| 2739 | ]], [[ |
| 2740 | if(EVP_DigestUpdate(NULL, NULL,0)) |
| 2741 | exit(0); |
| 2742 | ]])], |
| 2743 | [ |
| 2744 | AC_MSG_RESULT([yes]) |
| 2745 | ], |
| 2746 | [ |
| 2747 | AC_MSG_RESULT([no]) |
| 2748 | AC_DEFINE([OPENSSL_EVP_DIGESTUPDATE_VOID], [1], |
| 2749 | [Define if EVP_DigestUpdate returns void]) |
| 2750 | ] |
| 2751 | ) |
| 2752 | |
| 2753 | # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, |
| 2754 | # because the system crypt() is more featureful. |
| 2755 | if test "x$check_for_libcrypt_before" = "x1"; then |
| 2756 | AC_CHECK_LIB([crypt], [crypt]) |
| 2757 | fi |
| 2758 | |
| 2759 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
| 2760 | # version in OpenSSL. |
| 2761 | if test "x$check_for_libcrypt_later" = "x1"; then |
| 2762 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
| 2763 | fi |
Damien Miller | 00797e8 | 2015-03-04 05:02:45 +1100 | [diff] [blame] | 2764 | AC_CHECK_FUNCS([crypt DES_crypt]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2765 | |
| 2766 | # Search for SHA256 support in libc and/or OpenSSL |
| 2767 | AC_CHECK_FUNCS([SHA256_Update EVP_sha256], , |
| 2768 | [unsupported_algorithms="$unsupported_algorithms \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2769 | hmac-sha2-256 \ |
| 2770 | hmac-sha2-512 \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2771 | diffie-hellman-group-exchange-sha256 \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2772 | hmac-sha2-256-etm@openssh.com \ |
| 2773 | hmac-sha2-512-etm@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2774 | ] |
| 2775 | ) |
| 2776 | # Search for RIPE-MD support in OpenSSL |
| 2777 | AC_CHECK_FUNCS([EVP_ripemd160], , |
| 2778 | [unsupported_algorithms="$unsupported_algorithms \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2779 | hmac-ripemd160 \ |
| 2780 | hmac-ripemd160@openssh.com \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2781 | hmac-ripemd160-etm@openssh.com" |
| 2782 | ] |
| 2783 | ) |
| 2784 | |
| 2785 | # Check complete ECC support in OpenSSL |
| 2786 | AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1]) |
| 2787 | AC_LINK_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> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2795 | ]], [[ |
| 2796 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); |
| 2797 | const EVP_MD *m = EVP_sha256(); /* We need this too */ |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2798 | ]])], |
| 2799 | [ AC_MSG_RESULT([yes]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2800 | enable_nistp256=1 ], |
| 2801 | [ AC_MSG_RESULT([no]) ] |
| 2802 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2803 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2804 | AC_MSG_CHECKING([whether OpenSSL has NID_secp384r1]) |
| 2805 | AC_LINK_IFELSE( |
| 2806 | [AC_LANG_PROGRAM([[ |
| 2807 | #include <openssl/ec.h> |
| 2808 | #include <openssl/ecdh.h> |
| 2809 | #include <openssl/ecdsa.h> |
| 2810 | #include <openssl/evp.h> |
| 2811 | #include <openssl/objects.h> |
| 2812 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2813 | ]], [[ |
| 2814 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp384r1); |
| 2815 | const EVP_MD *m = EVP_sha384(); /* We need this too */ |
| 2816 | ]])], |
| 2817 | [ AC_MSG_RESULT([yes]) |
| 2818 | enable_nistp384=1 ], |
| 2819 | [ AC_MSG_RESULT([no]) ] |
| 2820 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2821 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2822 | AC_MSG_CHECKING([whether OpenSSL has NID_secp521r1]) |
| 2823 | AC_LINK_IFELSE( |
| 2824 | [AC_LANG_PROGRAM([[ |
| 2825 | #include <openssl/ec.h> |
| 2826 | #include <openssl/ecdh.h> |
| 2827 | #include <openssl/ecdsa.h> |
| 2828 | #include <openssl/evp.h> |
| 2829 | #include <openssl/objects.h> |
| 2830 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2831 | ]], [[ |
| 2832 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2833 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2834 | ]])], |
| 2835 | [ AC_MSG_RESULT([yes]) |
| 2836 | AC_MSG_CHECKING([if OpenSSL's NID_secp521r1 is functional]) |
| 2837 | AC_RUN_IFELSE( |
| 2838 | [AC_LANG_PROGRAM([[ |
| 2839 | #include <openssl/ec.h> |
| 2840 | #include <openssl/ecdh.h> |
| 2841 | #include <openssl/ecdsa.h> |
| 2842 | #include <openssl/evp.h> |
| 2843 | #include <openssl/objects.h> |
| 2844 | #include <openssl/opensslv.h> |
| 2845 | ]],[[ |
| 2846 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2847 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2848 | exit(e == NULL || m == NULL); |
| 2849 | ]])], |
| 2850 | [ AC_MSG_RESULT([yes]) |
| 2851 | enable_nistp521=1 ], |
| 2852 | [ AC_MSG_RESULT([no]) ], |
| 2853 | [ AC_MSG_WARN([cross-compiling: assuming yes]) |
| 2854 | enable_nistp521=1 ] |
| 2855 | )], |
| 2856 | AC_MSG_RESULT([no]) |
| 2857 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2858 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2859 | COMMENT_OUT_ECC="#no ecc#" |
| 2860 | TEST_SSH_ECC=no |
| 2861 | |
| 2862 | if test x$enable_nistp256 = x1 || test x$enable_nistp384 = x1 || \ |
| 2863 | test x$enable_nistp521 = x1; then |
| 2864 | AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) |
| 2865 | fi |
| 2866 | if test x$enable_nistp256 = x1; then |
| 2867 | AC_DEFINE([OPENSSL_HAS_NISTP256], [1], |
| 2868 | [libcrypto has NID_X9_62_prime256v1]) |
| 2869 | TEST_SSH_ECC=yes |
| 2870 | COMMENT_OUT_ECC="" |
| 2871 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2872 | unsupported_algorithms="$unsupported_algorithms \ |
| 2873 | ecdsa-sha2-nistp256 \ |
| 2874 | ecdh-sha2-nistp256 \ |
| 2875 | ecdsa-sha2-nistp256-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2876 | fi |
| 2877 | if test x$enable_nistp384 = x1; then |
| 2878 | AC_DEFINE([OPENSSL_HAS_NISTP384], [1], [libcrypto has NID_secp384r1]) |
| 2879 | TEST_SSH_ECC=yes |
| 2880 | COMMENT_OUT_ECC="" |
| 2881 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2882 | unsupported_algorithms="$unsupported_algorithms \ |
| 2883 | ecdsa-sha2-nistp384 \ |
| 2884 | ecdh-sha2-nistp384 \ |
| 2885 | ecdsa-sha2-nistp384-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2886 | fi |
| 2887 | if test x$enable_nistp521 = x1; then |
| 2888 | AC_DEFINE([OPENSSL_HAS_NISTP521], [1], [libcrypto has NID_secp521r1]) |
| 2889 | TEST_SSH_ECC=yes |
| 2890 | COMMENT_OUT_ECC="" |
| 2891 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2892 | unsupported_algorithms="$unsupported_algorithms \ |
| 2893 | ecdh-sha2-nistp521 \ |
| 2894 | ecdsa-sha2-nistp521 \ |
| 2895 | ecdsa-sha2-nistp521-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2896 | fi |
| 2897 | |
| 2898 | AC_SUBST([TEST_SSH_ECC]) |
| 2899 | AC_SUBST([COMMENT_OUT_ECC]) |
| 2900 | else |
| 2901 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
Damien Miller | 00797e8 | 2015-03-04 05:02:45 +1100 | [diff] [blame] | 2902 | AC_CHECK_FUNCS([crypt]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2903 | fi |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2904 | |
Damien Miller | 00f9cd2 | 2014-07-15 10:41:38 +1000 | [diff] [blame] | 2905 | AC_CHECK_FUNCS([ \ |
| 2906 | arc4random \ |
| 2907 | arc4random_buf \ |
| 2908 | arc4random_stir \ |
| 2909 | arc4random_uniform \ |
| 2910 | ]) |
| 2911 | |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2912 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2913 | AC_CHECK_LIB([iaf], [ia_openinfo], [ |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2914 | LIBS="$LIBS -liaf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2915 | AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf" |
| 2916 | AC_DEFINE([HAVE_LIBIAF], [1], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 2917 | [Define if system has libiaf that supports set_id]) |
Tim Rice | 0eeaf12 | 2007-09-10 16:24:17 -0700 | [diff] [blame] | 2918 | ]) |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2919 | ]) |
| 2920 | LIBS="$saved_LIBS" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2921 | |
| 2922 | ### Configure cryptographic random number support |
| 2923 | |
| 2924 | # Check wheter OpenSSL seeds itself |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2925 | if test "x$openssl" = "xyes" ; then |
| 2926 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
| 2927 | AC_RUN_IFELSE( |
| 2928 | [AC_LANG_PROGRAM([[ |
| 2929 | #include <string.h> |
| 2930 | #include <openssl/rand.h> |
| 2931 | ]], [[ |
| 2932 | exit(RAND_status() == 1 ? 0 : 1); |
| 2933 | ]])], |
| 2934 | [ |
| 2935 | OPENSSL_SEEDS_ITSELF=yes |
| 2936 | AC_MSG_RESULT([yes]) |
| 2937 | ], |
| 2938 | [ |
| 2939 | AC_MSG_RESULT([no]) |
| 2940 | ], |
| 2941 | [ |
| 2942 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 2943 | # This is safe, since we will fatal() at runtime if |
| 2944 | # OpenSSL is not seeded correctly. |
| 2945 | OPENSSL_SEEDS_ITSELF=yes |
| 2946 | ] |
| 2947 | ) |
| 2948 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2949 | |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 2950 | # PRNGD TCP socket |
| 2951 | AC_ARG_WITH([prngd-port], |
| 2952 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 2953 | [ |
| 2954 | case "$withval" in |
| 2955 | no) |
| 2956 | withval="" |
| 2957 | ;; |
| 2958 | [[0-9]]*) |
| 2959 | ;; |
| 2960 | *) |
| 2961 | AC_MSG_ERROR([You must specify a numeric port number for --with-prngd-port]) |
| 2962 | ;; |
| 2963 | esac |
| 2964 | if test ! -z "$withval" ; then |
| 2965 | PRNGD_PORT="$withval" |
| 2966 | AC_DEFINE_UNQUOTED([PRNGD_PORT], [$PRNGD_PORT], |
| 2967 | [Port number of PRNGD/EGD random number socket]) |
| 2968 | fi |
| 2969 | ] |
| 2970 | ) |
| 2971 | |
| 2972 | # PRNGD Unix domain socket |
| 2973 | AC_ARG_WITH([prngd-socket], |
| 2974 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 2975 | [ |
| 2976 | case "$withval" in |
| 2977 | yes) |
| 2978 | withval="/var/run/egd-pool" |
| 2979 | ;; |
| 2980 | no) |
| 2981 | withval="" |
| 2982 | ;; |
| 2983 | /*) |
| 2984 | ;; |
| 2985 | *) |
| 2986 | AC_MSG_ERROR([You must specify an absolute path to the entropy socket]) |
| 2987 | ;; |
| 2988 | esac |
| 2989 | |
| 2990 | if test ! -z "$withval" ; then |
| 2991 | if test ! -z "$PRNGD_PORT" ; then |
| 2992 | AC_MSG_ERROR([You may not specify both a PRNGD/EGD port and socket]) |
| 2993 | fi |
| 2994 | if test ! -r "$withval" ; then |
| 2995 | AC_MSG_WARN([Entropy socket is not readable]) |
| 2996 | fi |
| 2997 | PRNGD_SOCKET="$withval" |
| 2998 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"], |
| 2999 | [Location of PRNGD/EGD random number socket]) |
| 3000 | fi |
| 3001 | ], |
| 3002 | [ |
| 3003 | # Check for existing socket only if we don't have a random device already |
| 3004 | if test "x$OPENSSL_SEEDS_ITSELF" != "xyes" ; then |
| 3005 | AC_MSG_CHECKING([for PRNGD/EGD socket]) |
| 3006 | # Insert other locations here |
| 3007 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 3008 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 3009 | PRNGD_SOCKET="$sock" |
| 3010 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"]) |
| 3011 | break; |
| 3012 | fi |
| 3013 | done |
| 3014 | if test ! -z "$PRNGD_SOCKET" ; then |
| 3015 | AC_MSG_RESULT([$PRNGD_SOCKET]) |
| 3016 | else |
| 3017 | AC_MSG_RESULT([not found]) |
| 3018 | fi |
| 3019 | fi |
| 3020 | ] |
| 3021 | ) |
| 3022 | |
| 3023 | # Which randomness source do we use? |
| 3024 | if test ! -z "$PRNGD_PORT" ; then |
| 3025 | RAND_MSG="PRNGd port $PRNGD_PORT" |
| 3026 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 3027 | RAND_MSG="PRNGd socket $PRNGD_SOCKET" |
| 3028 | elif test ! -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 3029 | AC_DEFINE([OPENSSL_PRNG_ONLY], [1], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3030 | [Define if you want the OpenSSL internally seeded PRNG only]) |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 3031 | RAND_MSG="OpenSSL internal ONLY" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3032 | elif test "x$openssl" = "xno" ; then |
| 3033 | 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] | 3034 | else |
| 3035 | 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]) |
| 3036 | fi |
| 3037 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3038 | # Check for PAM libs |
| 3039 | PAM_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3040 | AC_ARG_WITH([pam], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3041 | [ --with-pam Enable PAM support ], |
| 3042 | [ |
| 3043 | if test "x$withval" != "xno" ; then |
| 3044 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ |
| 3045 | test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then |
| 3046 | AC_MSG_ERROR([PAM headers not found]) |
| 3047 | fi |
| 3048 | |
| 3049 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3050 | AC_CHECK_LIB([dl], [dlopen], , ) |
| 3051 | AC_CHECK_LIB([pam], [pam_set_item], , [AC_MSG_ERROR([*** libpam missing])]) |
| 3052 | AC_CHECK_FUNCS([pam_getenvlist]) |
| 3053 | AC_CHECK_FUNCS([pam_putenv]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3054 | LIBS="$saved_LIBS" |
| 3055 | |
| 3056 | PAM_MSG="yes" |
| 3057 | |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3058 | SSHDLIBS="$SSHDLIBS -lpam" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3059 | AC_DEFINE([USE_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3060 | [Define if you want to enable PAM support]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3061 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3062 | if test $ac_cv_lib_dl_dlopen = yes; then |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3063 | case "$LIBS" in |
| 3064 | *-ldl*) |
| 3065 | # libdl already in LIBS |
| 3066 | ;; |
| 3067 | *) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3068 | SSHDLIBS="$SSHDLIBS -ldl" |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3069 | ;; |
| 3070 | esac |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3071 | fi |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3072 | fi |
| 3073 | ] |
| 3074 | ) |
| 3075 | |
Damien Miller | 8bd81e1 | 2016-08-16 13:30:56 +1000 | [diff] [blame] | 3076 | AC_ARG_WITH([pam-service], |
| 3077 | [ --with-pam-service=name Specify PAM service name ], |
| 3078 | [ |
| 3079 | if test "x$withval" != "xno" && \ |
| 3080 | test "x$withval" != "xyes" ; then |
| 3081 | AC_DEFINE_UNQUOTED([SSHD_PAM_SERVICE], |
| 3082 | ["$withval"], [sshd PAM service name]) |
| 3083 | fi |
| 3084 | ] |
| 3085 | ) |
| 3086 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3087 | # Check for older PAM |
| 3088 | if test "x$PAM_MSG" = "xyes" ; then |
| 3089 | # Check PAM strerror arguments (old PAM) |
| 3090 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3091 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3092 | #include <stdlib.h> |
| 3093 | #if defined(HAVE_SECURITY_PAM_APPL_H) |
| 3094 | #include <security/pam_appl.h> |
| 3095 | #elif defined (HAVE_PAM_PAM_APPL_H) |
| 3096 | #include <pam/pam_appl.h> |
| 3097 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3098 | ]], [[ |
| 3099 | (void)pam_strerror((pam_handle_t *)NULL, -1); |
| 3100 | ]])], [AC_MSG_RESULT([no])], [ |
| 3101 | AC_DEFINE([HAVE_OLD_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3102 | [Define if you have an old version of PAM |
| 3103 | which takes only one argument to pam_strerror]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3104 | AC_MSG_RESULT([yes]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3105 | PAM_MSG="yes (old library)" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3106 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3107 | ]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3108 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3109 | |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 3110 | case "$host" in |
| 3111 | *-*-cygwin*) |
| 3112 | SSH_PRIVSEP_USER=CYGWIN_SSH_PRIVSEP_USER |
| 3113 | ;; |
| 3114 | *) |
| 3115 | SSH_PRIVSEP_USER=sshd |
| 3116 | ;; |
| 3117 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3118 | AC_ARG_WITH([privsep-user], |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 3119 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3120 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3121 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3122 | test "x${withval}" != "xyes"; then |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 3123 | SSH_PRIVSEP_USER=$withval |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3124 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3125 | ] |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3126 | ) |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 3127 | if test "x$SSH_PRIVSEP_USER" = "xCYGWIN_SSH_PRIVSEP_USER" ; then |
| 3128 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], [CYGWIN_SSH_PRIVSEP_USER], |
| 3129 | [Cygwin function to fetch non-privileged user for privilege separation]) |
| 3130 | else |
| 3131 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], ["$SSH_PRIVSEP_USER"], |
| 3132 | [non-privileged user for privilege separation]) |
| 3133 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3134 | AC_SUBST([SSH_PRIVSEP_USER]) |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3135 | |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3136 | if test "x$have_linux_no_new_privs" = "x1" ; then |
| 3137 | AC_CHECK_DECL([SECCOMP_MODE_FILTER], [have_seccomp_filter=1], , [ |
| 3138 | #include <sys/types.h> |
| 3139 | #include <linux/seccomp.h> |
| 3140 | ]) |
| 3141 | fi |
| 3142 | if test "x$have_seccomp_filter" = "x1" ; then |
| 3143 | AC_MSG_CHECKING([kernel for seccomp_filter support]) |
| 3144 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3145 | #include <errno.h> |
| 3146 | #include <elf.h> |
| 3147 | #include <linux/audit.h> |
| 3148 | #include <linux/seccomp.h> |
| 3149 | #include <stdlib.h> |
| 3150 | #include <sys/prctl.h> |
| 3151 | ]], |
| 3152 | [[ int i = $seccomp_audit_arch; |
| 3153 | errno = 0; |
| 3154 | prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0); |
| 3155 | exit(errno == EFAULT ? 0 : 1); ]])], |
| 3156 | [ AC_MSG_RESULT([yes]) ], [ |
| 3157 | AC_MSG_RESULT([no]) |
| 3158 | # Disable seccomp filter as a target |
| 3159 | have_seccomp_filter=0 |
| 3160 | ] |
| 3161 | ) |
| 3162 | fi |
| 3163 | |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3164 | # Decide which sandbox style to use |
| 3165 | sandbox_arg="" |
| 3166 | AC_ARG_WITH([sandbox], |
deraadt@openbsd.org | 2539dce | 2015-10-09 01:37:08 +0000 | [diff] [blame] | 3167 | [ --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] | 3168 | [ |
| 3169 | if test "x$withval" = "xyes" ; then |
| 3170 | sandbox_arg="" |
| 3171 | else |
| 3172 | sandbox_arg="$withval" |
| 3173 | fi |
| 3174 | ] |
| 3175 | ) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3176 | |
| 3177 | # Some platforms (seems to be the ones that have a kernel poll(2)-type |
| 3178 | # function with which they implement select(2)) use an extra file descriptor |
| 3179 | # when calling select(2), which means we can't use the rlimit sandbox. |
| 3180 | AC_MSG_CHECKING([if select works with descriptor rlimit]) |
| 3181 | AC_RUN_IFELSE( |
| 3182 | [AC_LANG_PROGRAM([[ |
| 3183 | #include <sys/types.h> |
| 3184 | #ifdef HAVE_SYS_TIME_H |
| 3185 | # include <sys/time.h> |
| 3186 | #endif |
| 3187 | #include <sys/resource.h> |
| 3188 | #ifdef HAVE_SYS_SELECT_H |
| 3189 | # include <sys/select.h> |
| 3190 | #endif |
| 3191 | #include <errno.h> |
| 3192 | #include <fcntl.h> |
| 3193 | #include <stdlib.h> |
| 3194 | ]],[[ |
| 3195 | struct rlimit rl_zero; |
| 3196 | int fd, r; |
| 3197 | fd_set fds; |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3198 | struct timeval tv; |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3199 | |
| 3200 | fd = open("/dev/null", O_RDONLY); |
| 3201 | FD_ZERO(&fds); |
| 3202 | FD_SET(fd, &fds); |
| 3203 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3204 | setrlimit(RLIMIT_FSIZE, &rl_zero); |
| 3205 | setrlimit(RLIMIT_NOFILE, &rl_zero); |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3206 | tv.tv_sec = 1; |
| 3207 | tv.tv_usec = 0; |
| 3208 | r = select(fd+1, &fds, NULL, NULL, &tv); |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3209 | exit (r == -1 ? 1 : 0); |
| 3210 | ]])], |
| 3211 | [AC_MSG_RESULT([yes]) |
| 3212 | select_works_with_rlimit=yes], |
| 3213 | [AC_MSG_RESULT([no]) |
| 3214 | select_works_with_rlimit=no], |
Mike Frysinger | dcc714c | 2017-05-24 23:21:19 -0400 | [diff] [blame] | 3215 | [AC_MSG_WARN([cross compiling: assuming yes]) |
| 3216 | select_works_with_rlimit=yes] |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3217 | ) |
| 3218 | |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3219 | AC_MSG_CHECKING([if setrlimit(RLIMIT_NOFILE,{0,0}) works]) |
| 3220 | AC_RUN_IFELSE( |
| 3221 | [AC_LANG_PROGRAM([[ |
| 3222 | #include <sys/types.h> |
| 3223 | #ifdef HAVE_SYS_TIME_H |
| 3224 | # include <sys/time.h> |
| 3225 | #endif |
| 3226 | #include <sys/resource.h> |
| 3227 | #include <errno.h> |
| 3228 | #include <stdlib.h> |
| 3229 | ]],[[ |
| 3230 | struct rlimit rl_zero; |
| 3231 | int fd, r; |
| 3232 | fd_set fds; |
| 3233 | |
| 3234 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3235 | r = setrlimit(RLIMIT_NOFILE, &rl_zero); |
| 3236 | exit (r == -1 ? 1 : 0); |
| 3237 | ]])], |
| 3238 | [AC_MSG_RESULT([yes]) |
| 3239 | rlimit_nofile_zero_works=yes], |
| 3240 | [AC_MSG_RESULT([no]) |
| 3241 | rlimit_nofile_zero_works=no], |
Mike Frysinger | dcc714c | 2017-05-24 23:21:19 -0400 | [diff] [blame] | 3242 | [AC_MSG_WARN([cross compiling: assuming yes]) |
| 3243 | rlimit_nofile_zero_works=yes] |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3244 | ) |
| 3245 | |
Darren Tucker | d545a4b | 2012-07-03 22:48:31 +1000 | [diff] [blame] | 3246 | AC_MSG_CHECKING([if setrlimit RLIMIT_FSIZE works]) |
| 3247 | AC_RUN_IFELSE( |
| 3248 | [AC_LANG_PROGRAM([[ |
| 3249 | #include <sys/types.h> |
| 3250 | #include <sys/resource.h> |
| 3251 | #include <stdlib.h> |
| 3252 | ]],[[ |
| 3253 | struct rlimit rl_zero; |
| 3254 | |
| 3255 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3256 | exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0); |
| 3257 | ]])], |
| 3258 | [AC_MSG_RESULT([yes])], |
| 3259 | [AC_MSG_RESULT([no]) |
| 3260 | AC_DEFINE(SANDBOX_SKIP_RLIMIT_FSIZE, 1, |
| 3261 | [setrlimit RLIMIT_FSIZE works])], |
| 3262 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 3263 | ) |
| 3264 | |
deraadt@openbsd.org | 2539dce | 2015-10-09 01:37:08 +0000 | [diff] [blame] | 3265 | if test "x$sandbox_arg" = "xpledge" || \ |
| 3266 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_pledge" = "xyes" ) ; then |
| 3267 | test "x$ac_cv_func_pledge" != "xyes" && \ |
| 3268 | AC_MSG_ERROR([pledge sandbox requires pledge(2) support]) |
| 3269 | SANDBOX_STYLE="pledge" |
Damien Miller | fafe1d8 | 2015-10-14 09:22:15 -0700 | [diff] [blame] | 3270 | AC_DEFINE([SANDBOX_PLEDGE], [1], [Sandbox using pledge(2)]) |
Damien Miller | 9846a2f | 2015-10-08 04:30:48 +1100 | [diff] [blame] | 3271 | elif test "x$sandbox_arg" = "xsystrace" || \ |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3272 | ( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3273 | test "x$have_systr_policy_kill" != "x1" && \ |
| 3274 | 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] | 3275 | SANDBOX_STYLE="systrace" |
| 3276 | AC_DEFINE([SANDBOX_SYSTRACE], [1], [Sandbox using systrace(4)]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 3277 | elif test "x$sandbox_arg" = "xdarwin" || \ |
| 3278 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \ |
| 3279 | test "x$ac_cv_header_sandbox_h" = "xyes") ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3280 | test "x$ac_cv_func_sandbox_init" != "xyes" -o \ |
| 3281 | "x$ac_cv_header_sandbox_h" != "xyes" && \ |
| 3282 | 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] | 3283 | SANDBOX_STYLE="darwin" |
| 3284 | AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3285 | elif test "x$sandbox_arg" = "xseccomp_filter" || \ |
| 3286 | ( test -z "$sandbox_arg" && \ |
Darren Tucker | d0494fd | 2012-05-19 14:25:39 +1000 | [diff] [blame] | 3287 | test "x$have_seccomp_filter" = "x1" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3288 | test "x$ac_cv_header_elf_h" = "xyes" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3289 | test "x$ac_cv_header_linux_audit_h" = "xyes" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3290 | test "x$ac_cv_header_linux_filter_h" = "xyes" && \ |
| 3291 | test "x$seccomp_audit_arch" != "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3292 | test "x$have_linux_no_new_privs" = "x1" && \ |
| 3293 | test "x$ac_cv_func_prctl" = "xyes" ) ; then |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3294 | test "x$seccomp_audit_arch" = "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3295 | AC_MSG_ERROR([seccomp_filter sandbox not supported on $host]) |
| 3296 | test "x$have_linux_no_new_privs" != "x1" && \ |
| 3297 | AC_MSG_ERROR([seccomp_filter sandbox requires PR_SET_NO_NEW_PRIVS]) |
| 3298 | test "x$have_seccomp_filter" != "x1" && \ |
| 3299 | AC_MSG_ERROR([seccomp_filter sandbox requires seccomp headers]) |
| 3300 | test "x$ac_cv_func_prctl" != "xyes" && \ |
| 3301 | AC_MSG_ERROR([seccomp_filter sandbox requires prctl function]) |
| 3302 | SANDBOX_STYLE="seccomp_filter" |
| 3303 | AC_DEFINE([SANDBOX_SECCOMP_FILTER], [1], [Sandbox using seccomp filter]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3304 | elif test "x$sandbox_arg" = "xcapsicum" || \ |
| 3305 | ( test -z "$sandbox_arg" && \ |
Darren Tucker | dd9d9b3 | 2017-08-28 16:48:27 +1000 | [diff] [blame] | 3306 | test "x$ac_cv_header_sys_capsicum_h" = "xyes" && \ |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3307 | test "x$ac_cv_func_cap_rights_limit" = "xyes") ; then |
Darren Tucker | dd9d9b3 | 2017-08-28 16:48:27 +1000 | [diff] [blame] | 3308 | test "x$ac_cv_header_sys_capsicum_h" != "xyes" && \ |
| 3309 | AC_MSG_ERROR([capsicum sandbox requires sys/capsicum.h header]) |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3310 | test "x$ac_cv_func_cap_rights_limit" != "xyes" && \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 3311 | AC_MSG_ERROR([capsicum sandbox requires cap_rights_limit function]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3312 | SANDBOX_STYLE="capsicum" |
| 3313 | AC_DEFINE([SANDBOX_CAPSICUM], [1], [Sandbox using capsicum]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3314 | elif test "x$sandbox_arg" = "xrlimit" || \ |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3315 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" && \ |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3316 | test "x$select_works_with_rlimit" = "xyes" && \ |
| 3317 | test "x$rlimit_nofile_zero_works" = "xyes" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3318 | test "x$ac_cv_func_setrlimit" != "xyes" && \ |
| 3319 | AC_MSG_ERROR([rlimit sandbox requires setrlimit function]) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3320 | test "x$select_works_with_rlimit" != "xyes" && \ |
| 3321 | AC_MSG_ERROR([rlimit sandbox requires select to work with rlimit]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3322 | SANDBOX_STYLE="rlimit" |
| 3323 | AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 3324 | elif test "x$sandbox_arg" = "xsolaris" || \ |
| 3325 | ( test -z "$sandbox_arg" && test "x$SOLARIS_PRIVS" = "xyes" ) ; then |
| 3326 | SANDBOX_STYLE="solaris" |
| 3327 | AC_DEFINE([SANDBOX_SOLARIS], [1], [Sandbox using Solaris/Illumos privileges]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3328 | elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \ |
| 3329 | test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then |
| 3330 | SANDBOX_STYLE="none" |
| 3331 | AC_DEFINE([SANDBOX_NULL], [1], [no privsep sandboxing]) |
| 3332 | else |
Tim Rice | a6e6061 | 2011-08-17 21:48:22 -0700 | [diff] [blame] | 3333 | AC_MSG_ERROR([unsupported --with-sandbox]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3334 | fi |
| 3335 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 3336 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 3337 | if test ! -z "$SONY" ; then |
| 3338 | LIBS="$LIBS -liberty"; |
| 3339 | fi |
| 3340 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3341 | # Check for long long datatypes |
| 3342 | AC_CHECK_TYPES([long long, unsigned long long, long double]) |
| 3343 | |
| 3344 | # Check datatype sizes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3345 | AC_CHECK_SIZEOF([short int], [2]) |
| 3346 | AC_CHECK_SIZEOF([int], [4]) |
| 3347 | AC_CHECK_SIZEOF([long int], [4]) |
| 3348 | AC_CHECK_SIZEOF([long long int], [8]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3349 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 3350 | # Sanity check long long for some platforms (AIX) |
| 3351 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 3352 | ac_cv_sizeof_long_long_int=0 |
| 3353 | fi |
| 3354 | |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3355 | # compute LLONG_MIN and LLONG_MAX if we don't know them. |
| 3356 | if test -z "$have_llong_max"; then |
| 3357 | AC_MSG_CHECKING([for max value of long long]) |
| 3358 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3359 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3360 | #include <stdio.h> |
| 3361 | /* Why is this so damn hard? */ |
| 3362 | #ifdef __GNUC__ |
| 3363 | # undef __GNUC__ |
| 3364 | #endif |
| 3365 | #define __USE_ISOC99 |
| 3366 | #include <limits.h> |
| 3367 | #define DATA "conftest.llminmax" |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3368 | #define my_abs(a) ((a) < 0 ? ((a) * -1) : (a)) |
| 3369 | |
| 3370 | /* |
| 3371 | * printf in libc on some platforms (eg old Tru64) does not understand %lld so |
| 3372 | * we do this the hard way. |
| 3373 | */ |
| 3374 | static int |
| 3375 | fprint_ll(FILE *f, long long n) |
| 3376 | { |
| 3377 | unsigned int i; |
| 3378 | int l[sizeof(long long) * 8]; |
| 3379 | |
| 3380 | if (n < 0) |
| 3381 | if (fprintf(f, "-") < 0) |
| 3382 | return -1; |
| 3383 | for (i = 0; n != 0; i++) { |
| 3384 | l[i] = my_abs(n % 10); |
| 3385 | n /= 10; |
| 3386 | } |
| 3387 | do { |
| 3388 | if (fprintf(f, "%d", l[--i]) < 0) |
| 3389 | return -1; |
| 3390 | } while (i != 0); |
| 3391 | if (fprintf(f, " ") < 0) |
| 3392 | return -1; |
| 3393 | return 0; |
| 3394 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3395 | ]], [[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3396 | FILE *f; |
| 3397 | long long i, llmin, llmax = 0; |
| 3398 | |
| 3399 | if((f = fopen(DATA,"w")) == NULL) |
| 3400 | exit(1); |
| 3401 | |
| 3402 | #if defined(LLONG_MIN) && defined(LLONG_MAX) |
| 3403 | fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); |
| 3404 | llmin = LLONG_MIN; |
| 3405 | llmax = LLONG_MAX; |
| 3406 | #else |
| 3407 | fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); |
| 3408 | /* This will work on one's complement and two's complement */ |
| 3409 | for (i = 1; i > llmax; i <<= 1, i++) |
| 3410 | llmax = i; |
| 3411 | llmin = llmax + 1LL; /* wrap */ |
| 3412 | #endif |
| 3413 | |
| 3414 | /* Sanity check */ |
| 3415 | if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3416 | || llmax - 1 > llmax || llmin == llmax || llmin == 0 |
| 3417 | || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) { |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3418 | fprintf(f, "unknown unknown\n"); |
| 3419 | exit(2); |
| 3420 | } |
| 3421 | |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3422 | if (fprint_ll(f, llmin) < 0) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3423 | exit(3); |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3424 | if (fprint_ll(f, llmax) < 0) |
| 3425 | exit(4); |
| 3426 | if (fclose(f) < 0) |
| 3427 | exit(5); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3428 | exit(0); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3429 | ]])], |
| 3430 | [ |
| 3431 | llong_min=`$AWK '{print $1}' conftest.llminmax` |
| 3432 | llong_max=`$AWK '{print $2}' conftest.llminmax` |
| 3433 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3434 | AC_MSG_RESULT([$llong_max]) |
| 3435 | AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3436 | [max value of long long calculated by configure]) |
| 3437 | AC_MSG_CHECKING([for min value of long long]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3438 | AC_MSG_RESULT([$llong_min]) |
| 3439 | AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3440 | [min value of long long calculated by configure]) |
| 3441 | ], |
| 3442 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3443 | AC_MSG_RESULT([not found]) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3444 | ], |
| 3445 | [ |
| 3446 | AC_MSG_WARN([cross compiling: not checking]) |
| 3447 | ] |
| 3448 | ) |
| 3449 | fi |
| 3450 | |
| 3451 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3452 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3453 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3454 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3455 | [[ u_int a; a = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3456 | [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3457 | ]) |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3458 | ]) |
| 3459 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3460 | 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] | 3461 | have_u_int=1 |
| 3462 | fi |
| 3463 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3464 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3465 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3466 | [[ 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] | 3467 | [ ac_cv_have_intxx_t="yes" ], [ ac_cv_have_intxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3468 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3469 | ]) |
| 3470 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3471 | 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] | 3472 | have_intxx_t=1 |
| 3473 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3474 | |
| 3475 | if (test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3476 | test "x$ac_cv_header_stdint_h" = "xyes") |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3477 | then |
| 3478 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3479 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3480 | [[ 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] | 3481 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3482 | AC_DEFINE([HAVE_INTXX_T]) |
| 3483 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3484 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3485 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3486 | fi |
| 3487 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3488 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3489 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | 907881e | 2002-07-18 11:44:50 -0700 | [diff] [blame] | 3490 | #include <sys/types.h> |
| 3491 | #ifdef HAVE_STDINT_H |
| 3492 | # include <stdint.h> |
| 3493 | #endif |
| 3494 | #include <sys/socket.h> |
| 3495 | #ifdef HAVE_SYS_BITYPES_H |
| 3496 | # include <sys/bitypes.h> |
| 3497 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3498 | ]], [[ |
| 3499 | int64_t a; a = 1; |
| 3500 | ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3501 | [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3502 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3503 | ]) |
| 3504 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3505 | 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] | 3506 | fi |
| 3507 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3508 | 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] | 3509 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3510 | [[ 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] | 3511 | [ 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] | 3512 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3513 | ]) |
| 3514 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3515 | 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] | 3516 | have_u_intxx_t=1 |
| 3517 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3518 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3519 | if test -z "$have_u_intxx_t" ; then |
| 3520 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3521 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]], |
| 3522 | [[ 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] | 3523 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3524 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3525 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3526 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3527 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3528 | fi |
| 3529 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3530 | 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] | 3531 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3532 | [[ u_int64_t a; a = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3533 | [ 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] | 3534 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3535 | ]) |
| 3536 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3537 | 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] | 3538 | have_u_int64_t=1 |
| 3539 | fi |
| 3540 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3541 | if (test -z "$have_u_int64_t" && \ |
| 3542 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
| 3543 | then |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3544 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3545 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]], |
| 3546 | [[ u_int64_t a; a = 1]])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3547 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3548 | AC_DEFINE([HAVE_U_INT64_T]) |
| 3549 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3550 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3551 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3552 | fi |
| 3553 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3554 | if test -z "$have_u_intxx_t" ; then |
| 3555 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3556 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3557 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3558 | ]], [[ |
| 3559 | uint8_t a; |
| 3560 | uint16_t b; |
| 3561 | uint32_t c; |
| 3562 | a = b = c = 1; |
| 3563 | ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3564 | [ ac_cv_have_uintxx_t="yes" ], [ ac_cv_have_uintxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3565 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3566 | ]) |
| 3567 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3568 | AC_DEFINE([HAVE_UINTXX_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3569 | [define if you have uintxx_t data type]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3570 | fi |
| 3571 | fi |
| 3572 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3573 | if (test -z "$have_uintxx_t" && \ |
| 3574 | test "x$ac_cv_header_stdint_h" = "xyes") |
| 3575 | then |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3576 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3577 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3578 | [[ 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] | 3579 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3580 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3581 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3582 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3583 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3584 | fi |
| 3585 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3586 | if (test -z "$have_uintxx_t" && \ |
| 3587 | test "x$ac_cv_header_inttypes_h" = "xyes") |
| 3588 | then |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3589 | AC_MSG_CHECKING([for uintXX_t types in inttypes.h]) |
| 3590 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <inttypes.h> ]], |
| 3591 | [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;]])], |
| 3592 | [ |
| 3593 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3594 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3595 | ], [ AC_MSG_RESULT([no]) |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3596 | ]) |
| 3597 | fi |
| 3598 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 3599 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3600 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3601 | then |
| 3602 | 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] | 3603 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3604 | #include <sys/bitypes.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3605 | ]], [[ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 3606 | int8_t a; int16_t b; int32_t c; |
| 3607 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 3608 | a = b = c = e = f = g = 1; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3609 | ]])], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3610 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3611 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3612 | AC_DEFINE([HAVE_INTXX_T]) |
| 3613 | AC_MSG_RESULT([yes]) |
| 3614 | ], [AC_MSG_RESULT([no]) |
| 3615 | ]) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3616 | fi |
| 3617 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3618 | |
| 3619 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3620 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3621 | [[ u_char foo; foo = 125; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3622 | [ ac_cv_have_u_char="yes" ], [ ac_cv_have_u_char="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3623 | ]) |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3624 | ]) |
| 3625 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3626 | 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] | 3627 | fi |
| 3628 | |
Darren Tucker | 007e3b3 | 2013-11-03 18:43:55 +1100 | [diff] [blame] | 3629 | AC_CHECK_TYPES([intmax_t, uintmax_t], , , [ |
| 3630 | #include <sys/types.h> |
| 3631 | #include <stdint.h> |
| 3632 | ]) |
| 3633 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3634 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 3635 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3636 | AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>]) |
| 3637 | AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 3638 | #include <sys/types.h> |
| 3639 | #ifdef HAVE_SYS_BITYPES_H |
| 3640 | #include <sys/bitypes.h> |
| 3641 | #endif |
| 3642 | #ifdef HAVE_SYS_STATFS_H |
| 3643 | #include <sys/statfs.h> |
| 3644 | #endif |
| 3645 | #ifdef HAVE_SYS_STATVFS_H |
| 3646 | #include <sys/statvfs.h> |
| 3647 | #endif |
| 3648 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3649 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3650 | AC_CHECK_TYPES([in_addr_t, in_port_t], , , |
Damien Miller | 848b993 | 2005-02-24 12:12:34 +1100 | [diff] [blame] | 3651 | [#include <sys/types.h> |
| 3652 | #include <netinet/in.h>]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 3653 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3654 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3655 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3656 | [[ size_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3657 | [ ac_cv_have_size_t="yes" ], [ ac_cv_have_size_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3658 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3659 | ]) |
| 3660 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3661 | 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] | 3662 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 3663 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3664 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3665 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3666 | [[ ssize_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3667 | [ ac_cv_have_ssize_t="yes" ], [ ac_cv_have_ssize_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3668 | ]) |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3669 | ]) |
| 3670 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3671 | 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] | 3672 | fi |
| 3673 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3674 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3675 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <time.h> ]], |
| 3676 | [[ clock_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3677 | [ ac_cv_have_clock_t="yes" ], [ ac_cv_have_clock_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3678 | ]) |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3679 | ]) |
| 3680 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3681 | 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] | 3682 | fi |
| 3683 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3684 | 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] | 3685 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3686 | #include <sys/types.h> |
| 3687 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3688 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
| 3689 | [ ac_cv_have_sa_family_t="yes" ], |
| 3690 | [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3691 | #include <sys/types.h> |
| 3692 | #include <sys/socket.h> |
| 3693 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3694 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3695 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3696 | [ ac_cv_have_sa_family_t="no" ] |
| 3697 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3698 | ]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3699 | ]) |
| 3700 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3701 | AC_DEFINE([HAVE_SA_FAMILY_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3702 | [define if you have sa_family_t data type]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3703 | fi |
| 3704 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3705 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3706 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3707 | [[ pid_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3708 | [ ac_cv_have_pid_t="yes" ], [ ac_cv_have_pid_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3709 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3710 | ]) |
| 3711 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3712 | 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] | 3713 | fi |
| 3714 | |
| 3715 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3716 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3717 | [[ mode_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3718 | [ ac_cv_have_mode_t="yes" ], [ ac_cv_have_mode_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3719 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3720 | ]) |
| 3721 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3722 | 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] | 3723 | fi |
| 3724 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3725 | |
| 3726 | 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] | 3727 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3728 | #include <sys/types.h> |
| 3729 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3730 | ]], [[ struct sockaddr_storage s; ]])], |
| 3731 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3732 | [ ac_cv_have_struct_sockaddr_storage="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3733 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3734 | ]) |
| 3735 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3736 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3737 | [define if you have struct sockaddr_storage data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3738 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3739 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3740 | 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] | 3741 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3742 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3743 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3744 | ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])], |
| 3745 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3746 | [ ac_cv_have_struct_sockaddr_in6="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3747 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3748 | ]) |
| 3749 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3750 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_IN6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3751 | [define if you have struct sockaddr_in6 data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3752 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3753 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3754 | 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] | 3755 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3756 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3757 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3758 | ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])], |
| 3759 | [ ac_cv_have_struct_in6_addr="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3760 | [ ac_cv_have_struct_in6_addr="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3761 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3762 | ]) |
| 3763 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3764 | AC_DEFINE([HAVE_STRUCT_IN6_ADDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3765 | [define if you have struct in6_addr data type]) |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3766 | |
| 3767 | dnl Now check for sin6_scope_id |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3768 | AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , , |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3769 | [ |
| 3770 | #ifdef HAVE_SYS_TYPES_H |
| 3771 | #include <sys/types.h> |
| 3772 | #endif |
| 3773 | #include <netinet/in.h> |
| 3774 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3775 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3776 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3777 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3778 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3779 | #include <sys/types.h> |
| 3780 | #include <sys/socket.h> |
| 3781 | #include <netdb.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3782 | ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])], |
| 3783 | [ ac_cv_have_struct_addrinfo="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3784 | [ ac_cv_have_struct_addrinfo="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3785 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3786 | ]) |
| 3787 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3788 | AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3789 | [define if you have struct addrinfo data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3790 | fi |
| 3791 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3792 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3793 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], |
| 3794 | [[ struct timeval tv; tv.tv_sec = 1;]])], |
| 3795 | [ ac_cv_have_struct_timeval="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3796 | [ ac_cv_have_struct_timeval="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3797 | ]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3798 | ]) |
| 3799 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3800 | AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3801 | have_struct_timeval=1 |
| 3802 | fi |
| 3803 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3804 | AC_CHECK_TYPES([struct timespec]) |
Tim Rice | 4e4dc56 | 2003-03-18 10:21:40 -0800 | [diff] [blame] | 3805 | |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3806 | # 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] | 3807 | if test "x$ac_cv_have_int64_t" = "xno" && \ |
| 3808 | test "x$ac_cv_sizeof_long_int" != "x8" && \ |
| 3809 | test "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3810 | echo "OpenSSH requires int64_t support. Contact your vendor or install" |
| 3811 | echo "an alternative compiler (I.E., GCC) before continuing." |
| 3812 | echo "" |
| 3813 | exit 1; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3814 | else |
| 3815 | dnl test snprintf (broken on SCO w/gcc) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3816 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3817 | [AC_LANG_SOURCE([[ |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3818 | #include <stdio.h> |
| 3819 | #include <string.h> |
| 3820 | #ifdef HAVE_SNPRINTF |
| 3821 | main() |
| 3822 | { |
| 3823 | char buf[50]; |
| 3824 | char expected_out[50]; |
| 3825 | int mazsize = 50 ; |
| 3826 | #if (SIZEOF_LONG_INT == 8) |
| 3827 | long int num = 0x7fffffffffffffff; |
| 3828 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 3829 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3830 | #endif |
| 3831 | strcpy(expected_out, "9223372036854775807"); |
| 3832 | snprintf(buf, mazsize, "%lld", num); |
| 3833 | if(strcmp(buf, expected_out) != 0) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3834 | exit(1); |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3835 | exit(0); |
| 3836 | } |
| 3837 | #else |
| 3838 | main() { exit(0); } |
| 3839 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3840 | ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3841 | AC_MSG_WARN([cross compiling: Assuming working snprintf()]) |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3842 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 3843 | fi |
| 3844 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3845 | dnl Checks for structure members |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3846 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmp.h], [HAVE_HOST_IN_UTMP]) |
| 3847 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmpx.h], [HAVE_HOST_IN_UTMPX]) |
| 3848 | OSSH_CHECK_HEADER_FOR_FIELD([syslen], [utmpx.h], [HAVE_SYSLEN_IN_UTMPX]) |
| 3849 | OSSH_CHECK_HEADER_FOR_FIELD([ut_pid], [utmp.h], [HAVE_PID_IN_UTMP]) |
| 3850 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmp.h], [HAVE_TYPE_IN_UTMP]) |
| 3851 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmpx.h], [HAVE_TYPE_IN_UTMPX]) |
| 3852 | OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmp.h], [HAVE_TV_IN_UTMP]) |
| 3853 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmp.h], [HAVE_ID_IN_UTMP]) |
| 3854 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmpx.h], [HAVE_ID_IN_UTMPX]) |
| 3855 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP]) |
| 3856 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX]) |
| 3857 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP]) |
| 3858 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX]) |
| 3859 | OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP]) |
| 3860 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP]) |
| 3861 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX]) |
| 3862 | 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] | 3863 | |
| 3864 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
Damien Miller | bcd1485 | 2017-06-10 23:41:25 +1000 | [diff] [blame] | 3865 | AC_CHECK_MEMBERS([struct stat.st_mtim]) |
| 3866 | AC_CHECK_MEMBERS([struct stat.st_mtime]) |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3867 | AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, |
| 3868 | struct passwd.pw_change, struct passwd.pw_expire], |
| 3869 | [], [], [[ |
| 3870 | #include <sys/types.h> |
| 3871 | #include <pwd.h> |
| 3872 | ]]) |
| 3873 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3874 | AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state], |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3875 | [Define if we don't have struct __res_state in resolv.h])], |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3876 | [[ |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3877 | #include <stdio.h> |
| 3878 | #if HAVE_SYS_TYPES_H |
| 3879 | # include <sys/types.h> |
| 3880 | #endif |
| 3881 | #include <netinet/in.h> |
| 3882 | #include <arpa/nameser.h> |
| 3883 | #include <resolv.h> |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3884 | ]]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3885 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3886 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 3887 | ac_cv_have_ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3888 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3889 | #include <sys/types.h> |
| 3890 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3891 | ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])], |
| 3892 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 3893 | [ ac_cv_have_ss_family_in_struct_ss="no" ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3894 | ]) |
| 3895 | 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] | 3896 | 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] | 3897 | fi |
| 3898 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3899 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 3900 | ac_cv_have___ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3901 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3902 | #include <sys/types.h> |
| 3903 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3904 | ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])], |
| 3905 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3906 | [ ac_cv_have___ss_family_in_struct_ss="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3907 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3908 | ]) |
| 3909 | 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] | 3910 | AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3911 | [Fields in struct sockaddr_storage]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3912 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 3913 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3914 | 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] | 3915 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 3916 | ac_cv_have_accrights_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3917 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3918 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3919 | #include <sys/socket.h> |
| 3920 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3921 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3922 | #ifdef msg_accrights |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3923 | #error "msg_accrights is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3924 | exit(1); |
| 3925 | #endif |
| 3926 | struct msghdr m; |
| 3927 | m.msg_accrights = 0; |
| 3928 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3929 | ]])], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3930 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 3931 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 3932 | ) |
| 3933 | ]) |
| 3934 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3935 | AC_DEFINE([HAVE_ACCRIGHTS_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3936 | [Define if your system uses access rights style |
| 3937 | file descriptor passing]) |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3938 | fi |
| 3939 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3940 | AC_MSG_CHECKING([if struct statvfs.f_fsid is integral type]) |
| 3941 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e1a3ddf | 2012-05-04 11:05:45 +1000 | [diff] [blame] | 3942 | #include <sys/param.h> |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3943 | #include <sys/stat.h> |
| 3944 | #ifdef HAVE_SYS_TIME_H |
| 3945 | # include <sys/time.h> |
| 3946 | #endif |
| 3947 | #ifdef HAVE_SYS_MOUNT_H |
| 3948 | #include <sys/mount.h> |
| 3949 | #endif |
| 3950 | #ifdef HAVE_SYS_STATVFS_H |
| 3951 | #include <sys/statvfs.h> |
| 3952 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3953 | ]], [[ struct statvfs s; s.f_fsid = 0; ]])], |
| 3954 | [ AC_MSG_RESULT([yes]) ], |
| 3955 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3956 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3957 | AC_MSG_CHECKING([if fsid_t has member val]) |
| 3958 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3959 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3960 | #include <sys/statvfs.h> |
| 3961 | ]], [[ fsid_t t; t.val[0] = 0; ]])], |
| 3962 | [ AC_MSG_RESULT([yes]) |
| 3963 | AC_DEFINE([FSID_HAS_VAL], [1], [fsid_t has member val]) ], |
| 3964 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3965 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3966 | AC_MSG_CHECKING([if f_fsid has member __val]) |
| 3967 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3968 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3969 | #include <sys/statvfs.h> |
| 3970 | ]], [[ fsid_t t; t.__val[0] = 0; ]])], |
| 3971 | [ AC_MSG_RESULT([yes]) |
| 3972 | AC_DEFINE([FSID_HAS___VAL], [1], [fsid_t has member __val]) ], |
| 3973 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3974 | ]) |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 3975 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3976 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 3977 | ac_cv_have_control_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3978 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3979 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3980 | #include <sys/socket.h> |
| 3981 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3982 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3983 | #ifdef msg_control |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3984 | #error "msg_control is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3985 | exit(1); |
| 3986 | #endif |
| 3987 | struct msghdr m; |
| 3988 | m.msg_control = 0; |
| 3989 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3990 | ]])], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3991 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 3992 | [ ac_cv_have_control_in_msghdr="no" ] |
| 3993 | ) |
| 3994 | ]) |
| 3995 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3996 | AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3997 | [Define if your system uses ancillary data style |
| 3998 | file descriptor passing]) |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3999 | fi |
| 4000 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4001 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4002 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4003 | [[ extern char *__progname; printf("%s", __progname); ]])], |
| 4004 | [ ac_cv_libc_defines___progname="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4005 | [ ac_cv_libc_defines___progname="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4006 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4007 | ]) |
| 4008 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4009 | AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4010 | fi |
| 4011 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4012 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4013 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 4014 | [[ printf("%s", __FUNCTION__); ]])], |
| 4015 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4016 | [ ac_cv_cc_implements___FUNCTION__="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4017 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4018 | ]) |
| 4019 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4020 | AC_DEFINE([HAVE___FUNCTION__], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4021 | [Define if compiler implements __FUNCTION__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4022 | fi |
| 4023 | |
| 4024 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4025 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 4026 | [[ printf("%s", __func__); ]])], |
| 4027 | [ ac_cv_cc_implements___func__="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4028 | [ ac_cv_cc_implements___func__="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4029 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4030 | ]) |
| 4031 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4032 | AC_DEFINE([HAVE___func__], [1], [Define if compiler implements __func__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4033 | fi |
| 4034 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4035 | AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4036 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 4037 | #include <stdarg.h> |
| 4038 | va_list x,y; |
| 4039 | ]], [[ va_copy(x,y); ]])], |
| 4040 | [ ac_cv_have_va_copy="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4041 | [ ac_cv_have_va_copy="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4042 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4043 | ]) |
| 4044 | if test "x$ac_cv_have_va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4045 | AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4046 | fi |
| 4047 | |
| 4048 | AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4049 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 4050 | #include <stdarg.h> |
| 4051 | va_list x,y; |
| 4052 | ]], [[ __va_copy(x,y); ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4053 | [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4054 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4055 | ]) |
| 4056 | if test "x$ac_cv_have___va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4057 | AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4058 | fi |
| 4059 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4060 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 4061 | ac_cv_have_getopt_optreset, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4062 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <getopt.h> ]], |
| 4063 | [[ extern int optreset; optreset = 0; ]])], |
| 4064 | [ ac_cv_have_getopt_optreset="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4065 | [ ac_cv_have_getopt_optreset="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4066 | ]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4067 | ]) |
| 4068 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4069 | AC_DEFINE([HAVE_GETOPT_OPTRESET], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4070 | [Define if your getopt(3) defines and uses optreset]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4071 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4072 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4073 | 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] | 4074 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4075 | [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])], |
| 4076 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4077 | [ ac_cv_libc_defines_sys_errlist="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4078 | ]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4079 | ]) |
| 4080 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4081 | AC_DEFINE([HAVE_SYS_ERRLIST], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4082 | [Define if your system defines sys_errlist[]]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4083 | fi |
| 4084 | |
| 4085 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 4086 | 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] | 4087 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4088 | [[ extern int sys_nerr; printf("%i", sys_nerr);]])], |
| 4089 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4090 | [ ac_cv_libc_defines_sys_nerr="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4091 | ]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 4092 | ]) |
| 4093 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4094 | 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] | 4095 | fi |
| 4096 | |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4097 | # Check libraries needed by DNS fingerprint support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4098 | AC_SEARCH_LIBS([getrrsetbyname], [resolv], |
| 4099 | [AC_DEFINE([HAVE_GETRRSETBYNAME], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4100 | [Define if getrrsetbyname() exists])], |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4101 | [ |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4102 | # Needed by our getrrsetbyname() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4103 | AC_SEARCH_LIBS([res_query], [resolv]) |
| 4104 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
| 4105 | AC_MSG_CHECKING([if res_query will link]) |
| 4106 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4107 | #include <sys/types.h> |
| 4108 | #include <netinet/in.h> |
| 4109 | #include <arpa/nameser.h> |
| 4110 | #include <netdb.h> |
| 4111 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4112 | ]], [[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4113 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4114 | ]])], |
| 4115 | AC_MSG_RESULT([yes]), |
| 4116 | [AC_MSG_RESULT([no]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4117 | saved_LIBS="$LIBS" |
| 4118 | LIBS="$LIBS -lresolv" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4119 | AC_MSG_CHECKING([for res_query in -lresolv]) |
| 4120 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4121 | #include <sys/types.h> |
| 4122 | #include <netinet/in.h> |
| 4123 | #include <arpa/nameser.h> |
| 4124 | #include <netdb.h> |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4125 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4126 | ]], [[ |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4127 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4128 | ]])], |
| 4129 | [AC_MSG_RESULT([yes])], |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4130 | [LIBS="$saved_LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4131 | AC_MSG_RESULT([no])]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4132 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4133 | AC_CHECK_FUNCS([_getshort _getlong]) |
Darren Tucker | d886e1c | 2005-06-01 18:57:45 +1000 | [diff] [blame] | 4134 | AC_CHECK_DECLS([_getshort, _getlong], , , |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 4135 | [#include <sys/types.h> |
| 4136 | #include <arpa/nameser.h>]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4137 | AC_CHECK_MEMBER([HEADER.ad], |
| 4138 | [AC_DEFINE([HAVE_HEADER_AD], [1], |
| 4139 | [Define if HEADER.ad exists in arpa/nameser.h])], , |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4140 | [#include <arpa/nameser.h>]) |
| 4141 | ]) |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4142 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4143 | AC_MSG_CHECKING([if struct __res_state _res is an extern]) |
| 4144 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4145 | #include <stdio.h> |
| 4146 | #if HAVE_SYS_TYPES_H |
| 4147 | # include <sys/types.h> |
| 4148 | #endif |
| 4149 | #include <netinet/in.h> |
| 4150 | #include <arpa/nameser.h> |
| 4151 | #include <resolv.h> |
| 4152 | extern struct __res_state _res; |
Darren Tucker | 7ad8b28 | 2015-09-11 13:11:02 +1000 | [diff] [blame] | 4153 | ]], [[ |
| 4154 | struct __res_state *volatile p = &_res; /* force resolution of _res */ |
| 4155 | return 0; |
| 4156 | ]],)], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4157 | [AC_MSG_RESULT([yes]) |
| 4158 | AC_DEFINE([HAVE__RES_EXTERN], [1], |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4159 | [Define if you have struct __res_state _res as an extern]) |
| 4160 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4161 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4162 | ) |
| 4163 | |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4164 | # Check whether user wants SELinux support |
| 4165 | SELINUX_MSG="no" |
| 4166 | LIBSELINUX="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4167 | AC_ARG_WITH([selinux], |
Damien Miller | 5b1c8b3 | 2008-03-27 12:33:07 +1100 | [diff] [blame] | 4168 | [ --with-selinux Enable SELinux support], |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4169 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4170 | save_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4171 | AC_DEFINE([WITH_SELINUX], [1], |
| 4172 | [Define if you want SELinux support.]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4173 | SELINUX_MSG="yes" |
| 4174 | AC_CHECK_HEADER([selinux/selinux.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4175 | AC_MSG_ERROR([SELinux support requires selinux.h header])) |
| 4176 | AC_CHECK_LIB([selinux], [setexeccon], |
Damien Miller | 1d2bfc4 | 2010-02-10 10:19:29 +1100 | [diff] [blame] | 4177 | [ LIBSELINUX="-lselinux" |
| 4178 | LIBS="$LIBS -lselinux" |
| 4179 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4180 | AC_MSG_ERROR([SELinux support requires libselinux library])) |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 4181 | SSHLIBS="$SSHLIBS $LIBSELINUX" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4182 | SSHDLIBS="$SSHDLIBS $LIBSELINUX" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4183 | AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level]) |
Darren Tucker | adc947d | 2006-10-07 09:07:20 +1000 | [diff] [blame] | 4184 | LIBS="$save_LIBS" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4185 | fi ] |
| 4186 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4187 | AC_SUBST([SSHLIBS]) |
| 4188 | AC_SUBST([SSHDLIBS]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4189 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4190 | # Check whether user wants Kerberos 5 support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4191 | KRB5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4192 | AC_ARG_WITH([kerberos5], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4193 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4194 | [ if test "x$withval" != "xno" ; then |
| 4195 | if test "x$withval" = "xyes" ; then |
| 4196 | KRB5ROOT="/usr/local" |
| 4197 | else |
| 4198 | KRB5ROOT=${withval} |
| 4199 | fi |
| 4200 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4201 | AC_DEFINE([KRB5], [1], [Define if you want Kerberos 5 support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4202 | KRB5_MSG="yes" |
| 4203 | |
Darren Tucker | 4089fc1 | 2016-12-08 12:57:24 +1100 | [diff] [blame] | 4204 | AC_PATH_TOOL([KRB5CONF], [krb5-config], |
Darren Tucker | dad48e7 | 2009-09-01 18:26:00 +1000 | [diff] [blame] | 4205 | [$KRB5ROOT/bin/krb5-config], |
| 4206 | [$KRB5ROOT/bin:$PATH]) |
| 4207 | if test -x $KRB5CONF ; then |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4208 | K5CFLAGS="`$KRB5CONF --cflags`" |
| 4209 | K5LIBS="`$KRB5CONF --libs`" |
| 4210 | CPPFLAGS="$CPPFLAGS $K5CFLAGS" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4211 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4212 | AC_MSG_CHECKING([for gssapi support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4213 | if $KRB5CONF | grep gssapi >/dev/null ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4214 | AC_MSG_RESULT([yes]) |
| 4215 | AC_DEFINE([GSSAPI], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4216 | [Define this if you want GSSAPI |
| 4217 | support in the version 2 protocol]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4218 | GSSCFLAGS="`$KRB5CONF --cflags gssapi`" |
| 4219 | GSSLIBS="`$KRB5CONF --libs gssapi`" |
| 4220 | CPPFLAGS="$CPPFLAGS $GSSCFLAGS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4221 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4222 | AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4223 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4224 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4225 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4226 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4227 | [ AC_MSG_RESULT([yes]) |
| 4228 | AC_DEFINE([HEIMDAL], [1], |
| 4229 | [Define this if you are using the Heimdal |
| 4230 | version of Kerberos V5]) ], |
| 4231 | [AC_MSG_RESULT([no]) |
| 4232 | ]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4233 | else |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4234 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4235 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4236 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4237 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4238 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4239 | [ AC_MSG_RESULT([yes]) |
| 4240 | AC_DEFINE([HEIMDAL]) |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4241 | K5LIBS="-lkrb5" |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4242 | K5LIBS="$K5LIBS -lcom_err -lasn1" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4243 | AC_CHECK_LIB([roken], [net_write], |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4244 | [K5LIBS="$K5LIBS -lroken"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4245 | AC_CHECK_LIB([des], [des_cbc_encrypt], |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4246 | [K5LIBS="$K5LIBS -ldes"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4247 | ], [ AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4248 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4249 | ]) |
| 4250 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4251 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4252 | AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context], |
| 4253 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4254 | GSSLIBS="-lgssapi_krb5" ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4255 | [ AC_CHECK_LIB([gssapi], [gss_init_sec_context], |
| 4256 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4257 | GSSLIBS="-lgssapi" ], |
Darren Tucker | a2b5a4c | 2013-02-22 10:43:15 +1100 | [diff] [blame] | 4258 | [ AC_CHECK_LIB([gss], [gss_init_sec_context], |
| 4259 | [ AC_DEFINE([GSSAPI]) |
| 4260 | GSSLIBS="-lgss" ], |
| 4261 | AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail])) |
| 4262 | ]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4263 | ]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4264 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4265 | AC_CHECK_HEADER([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4266 | [ unset ac_cv_header_gssapi_h |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4267 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4268 | AC_CHECK_HEADERS([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4269 | 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] | 4270 | ) |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4271 | ] |
| 4272 | ) |
| 4273 | |
| 4274 | oldCPP="$CPPFLAGS" |
| 4275 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4276 | AC_CHECK_HEADER([gssapi_krb5.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4277 | [ CPPFLAGS="$oldCPP" ]) |
| 4278 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4279 | fi |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4280 | if test ! -z "$need_dash_r" ; then |
| 4281 | LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" |
| 4282 | fi |
| 4283 | if test ! -z "$blibpath" ; then |
| 4284 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 4285 | fi |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4286 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4287 | AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h]) |
| 4288 | AC_CHECK_HEADERS([gssapi_krb5.h gssapi/gssapi_krb5.h]) |
| 4289 | AC_CHECK_HEADERS([gssapi_generic.h gssapi/gssapi_generic.h]) |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4290 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4291 | AC_SEARCH_LIBS([k_hasafs], [kafs], [AC_DEFINE([USE_AFS], [1], |
| 4292 | [Define this if you want to use libkafs' AFS support])]) |
Darren Tucker | 03978c6 | 2013-02-25 11:24:44 +1100 | [diff] [blame] | 4293 | |
| 4294 | AC_CHECK_DECLS([GSS_C_NT_HOSTBASED_SERVICE], [], [], [[ |
| 4295 | #ifdef HAVE_GSSAPI_H |
| 4296 | # include <gssapi.h> |
| 4297 | #elif defined(HAVE_GSSAPI_GSSAPI_H) |
| 4298 | # include <gssapi/gssapi.h> |
| 4299 | #endif |
| 4300 | |
| 4301 | #ifdef HAVE_GSSAPI_GENERIC_H |
| 4302 | # include <gssapi_generic.h> |
| 4303 | #elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H) |
| 4304 | # include <gssapi/gssapi_generic.h> |
| 4305 | #endif |
| 4306 | ]]) |
Darren Tucker | f3ab2c5 | 2013-08-04 21:48:41 +1000 | [diff] [blame] | 4307 | saved_LIBS="$LIBS" |
| 4308 | LIBS="$LIBS $K5LIBS" |
| 4309 | AC_CHECK_FUNCS([krb5_cc_new_unique krb5_get_error_message krb5_free_error_message]) |
| 4310 | LIBS="$saved_LIBS" |
| 4311 | |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4312 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4313 | ] |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4314 | ) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4315 | AC_SUBST([GSSLIBS]) |
| 4316 | AC_SUBST([K5LIBS]) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 4317 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4318 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4319 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4320 | PRIVSEP_PATH=/var/empty |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4321 | AC_ARG_WITH([privsep-path], |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 4322 | [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4323 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4324 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4325 | test "x${withval}" != "xyes"; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4326 | PRIVSEP_PATH=$withval |
| 4327 | fi |
| 4328 | ] |
| 4329 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4330 | AC_SUBST([PRIVSEP_PATH]) |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4331 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4332 | AC_ARG_WITH([xauth], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4333 | [ --with-xauth=PATH Specify path to xauth program ], |
| 4334 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4335 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4336 | test "x${withval}" != "xyes"; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4337 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4338 | fi |
| 4339 | ], |
| 4340 | [ |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4341 | TestPath="$PATH" |
| 4342 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" |
| 4343 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" |
| 4344 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" |
| 4345 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4346 | AC_PATH_PROG([xauth_path], [xauth], , [$TestPath]) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 4347 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4348 | xauth_path="/usr/openwin/bin/xauth" |
| 4349 | fi |
| 4350 | ] |
| 4351 | ) |
| 4352 | |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4353 | STRIP_OPT=-s |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4354 | AC_ARG_ENABLE([strip], |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4355 | [ --disable-strip Disable calling strip(1) on install], |
| 4356 | [ |
| 4357 | if test "x$enableval" = "xno" ; then |
| 4358 | STRIP_OPT= |
| 4359 | fi |
| 4360 | ] |
| 4361 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4362 | AC_SUBST([STRIP_OPT]) |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4363 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4364 | if test -z "$xauth_path" ; then |
| 4365 | XAUTH_PATH="undefined" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4366 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4367 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4368 | AC_DEFINE_UNQUOTED([XAUTH_PATH], ["$xauth_path"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4369 | [Define if xauth is found in your path]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4370 | XAUTH_PATH=$xauth_path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4371 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4372 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4373 | |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4374 | dnl # --with-maildir=/path/to/mail gets top priority. |
| 4375 | dnl # if maildir is set in the platform case statement above we use that. |
| 4376 | dnl # Otherwise we run a program to get the dir from system headers. |
| 4377 | dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL |
| 4378 | dnl # If we find _PATH_MAILDIR we do nothing because that is what |
| 4379 | dnl # session.c expects anyway. Otherwise we set to the value found |
| 4380 | dnl # stripping any trailing slash. If for some strage reason our program |
| 4381 | dnl # does not find what it needs, we default to /var/spool/mail. |
| 4382 | # Check for mail directory |
| 4383 | AC_ARG_WITH([maildir], |
| 4384 | [ --with-maildir=/path/to/mail Specify your system mail directory], |
| 4385 | [ |
| 4386 | if test "X$withval" != X && test "x$withval" != xno && \ |
| 4387 | test "x${withval}" != xyes; then |
| 4388 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"], |
| 4389 | [Set this to your mail directory if you do not have _PATH_MAILDIR]) |
| 4390 | fi |
| 4391 | ],[ |
| 4392 | if test "X$maildir" != "X"; then |
| 4393 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4394 | else |
| 4395 | AC_MSG_CHECKING([Discovering system mail directory]) |
| 4396 | AC_RUN_IFELSE( |
| 4397 | [AC_LANG_PROGRAM([[ |
| 4398 | #include <stdio.h> |
| 4399 | #include <string.h> |
| 4400 | #ifdef HAVE_PATHS_H |
| 4401 | #include <paths.h> |
| 4402 | #endif |
| 4403 | #ifdef HAVE_MAILLOCK_H |
| 4404 | #include <maillock.h> |
| 4405 | #endif |
| 4406 | #define DATA "conftest.maildir" |
| 4407 | ]], [[ |
| 4408 | FILE *fd; |
| 4409 | int rc; |
| 4410 | |
| 4411 | fd = fopen(DATA,"w"); |
| 4412 | if(fd == NULL) |
| 4413 | exit(1); |
| 4414 | |
| 4415 | #if defined (_PATH_MAILDIR) |
| 4416 | if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0) |
| 4417 | exit(1); |
| 4418 | #elif defined (MAILDIR) |
| 4419 | if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0) |
| 4420 | exit(1); |
| 4421 | #elif defined (_PATH_MAIL) |
| 4422 | if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0) |
| 4423 | exit(1); |
| 4424 | #else |
| 4425 | exit (2); |
| 4426 | #endif |
| 4427 | |
| 4428 | exit(0); |
| 4429 | ]])], |
| 4430 | [ |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4431 | maildir_what=`awk -F: '{print $1}' conftest.maildir` |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4432 | maildir=`awk -F: '{print $2}' conftest.maildir \ |
| 4433 | | sed 's|/$||'` |
| 4434 | AC_MSG_RESULT([Using: $maildir from $maildir_what]) |
| 4435 | if test "x$maildir_what" != "x_PATH_MAILDIR"; then |
| 4436 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4437 | fi |
| 4438 | ], |
| 4439 | [ |
| 4440 | if test "X$ac_status" = "X2";then |
| 4441 | # our test program didn't find it. Default to /var/spool/mail |
| 4442 | AC_MSG_RESULT([Using: default value of /var/spool/mail]) |
| 4443 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"]) |
| 4444 | else |
| 4445 | AC_MSG_RESULT([*** not found ***]) |
| 4446 | fi |
| 4447 | ], |
| 4448 | [ |
| 4449 | AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail]) |
| 4450 | ] |
| 4451 | ) |
| 4452 | fi |
| 4453 | ] |
| 4454 | ) # maildir |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4455 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4456 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4457 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) |
| 4458 | disable_ptmx_check=yes |
| 4459 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4460 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4461 | if test "x$disable_ptmx_check" != "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4462 | AC_CHECK_FILE(["/dev/ptmx"], |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4463 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4464 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTMX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4465 | [Define if you have /dev/ptmx]) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4466 | have_dev_ptmx=1 |
| 4467 | ] |
| 4468 | ) |
| 4469 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4470 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4471 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4472 | if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4473 | AC_CHECK_FILE(["/dev/ptc"], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4474 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4475 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTS_AND_PTC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4476 | [Define if you have /dev/ptc]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4477 | have_dev_ptc=1 |
| 4478 | ] |
| 4479 | ) |
| 4480 | else |
| 4481 | AC_MSG_WARN([cross compiling: Disabling /dev/ptc test]) |
| 4482 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 4483 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4484 | # Options from here on. Some of these are preset by platform above |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4485 | AC_ARG_WITH([mantype], |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4486 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4487 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4488 | case "$withval" in |
| 4489 | man|cat|doc) |
| 4490 | MANTYPE=$withval |
| 4491 | ;; |
| 4492 | *) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4493 | AC_MSG_ERROR([invalid man type: $withval]) |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4494 | ;; |
| 4495 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4496 | ] |
| 4497 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4498 | if test -z "$MANTYPE"; then |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4499 | TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4500 | AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4501 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4502 | MANTYPE=doc |
| 4503 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4504 | MANTYPE=man |
| 4505 | else |
| 4506 | MANTYPE=cat |
| 4507 | fi |
| 4508 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4509 | AC_SUBST([MANTYPE]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4510 | if test "$MANTYPE" = "doc"; then |
| 4511 | mansubdir=man; |
| 4512 | else |
| 4513 | mansubdir=$MANTYPE; |
| 4514 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4515 | AC_SUBST([mansubdir]) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4516 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4517 | # Check whether to enable MD5 passwords |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4518 | MD5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4519 | AC_ARG_WITH([md5-passwords], |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4520 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4521 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 4522 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4523 | AC_DEFINE([HAVE_MD5_PASSWORDS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4524 | [Define if you want to allow MD5 passwords]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4525 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4526 | fi |
| 4527 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4528 | ) |
| 4529 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4530 | # Whether to disable shadow password support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4531 | AC_ARG_WITH([shadow], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4532 | [ --without-shadow Disable shadow password support], |
| 4533 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4534 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4535 | AC_DEFINE([DISABLE_SHADOW]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4536 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4537 | fi |
| 4538 | ] |
| 4539 | ) |
| 4540 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4541 | if test -z "$disable_shadow" ; then |
| 4542 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4543 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4544 | #include <sys/types.h> |
| 4545 | #include <shadow.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4546 | struct spwd sp; |
| 4547 | ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])], |
| 4548 | [ sp_expire_available=yes ], [ |
| 4549 | ]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4550 | |
| 4551 | if test "x$sp_expire_available" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4552 | AC_MSG_RESULT([yes]) |
| 4553 | AC_DEFINE([HAS_SHADOW_EXPIRE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4554 | [Define if you want to use shadow password expire field]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4555 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4556 | AC_MSG_RESULT([no]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4557 | fi |
| 4558 | fi |
| 4559 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4560 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4561 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 4562 | DISPLAY_HACK_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4563 | AC_DEFINE([IPADDR_IN_DISPLAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4564 | [Define if you need to use IP address |
| 4565 | instead of hostname in $DISPLAY]) |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4566 | else |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4567 | DISPLAY_HACK_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4568 | AC_ARG_WITH([ipaddr-display], |
Tim Rice | 6397eed | 2015-06-03 21:41:11 -0700 | [diff] [blame] | 4569 | [ --with-ipaddr-display Use ip address instead of hostname in $DISPLAY], |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4570 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4571 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4572 | AC_DEFINE([IPADDR_IN_DISPLAY]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4573 | DISPLAY_HACK_MSG="yes" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4574 | fi |
| 4575 | ] |
| 4576 | ) |
| 4577 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4578 | |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4579 | # check for /etc/default/login and use it if present. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4580 | AC_ARG_ENABLE([etc-default-login], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 4581 | [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4582 | [ if test "x$enableval" = "xno"; then |
| 4583 | AC_MSG_NOTICE([/etc/default/login handling disabled]) |
| 4584 | etc_default_login=no |
| 4585 | else |
| 4586 | etc_default_login=yes |
| 4587 | fi ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4588 | [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; |
| 4589 | then |
| 4590 | AC_MSG_WARN([cross compiling: not checking /etc/default/login]) |
| 4591 | etc_default_login=no |
| 4592 | else |
| 4593 | etc_default_login=yes |
| 4594 | fi ] |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4595 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4596 | |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4597 | if test "x$etc_default_login" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4598 | AC_CHECK_FILE(["/etc/default/login"], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4599 | [ external_path_file=/etc/default/login ]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4600 | if test "x$external_path_file" = "x/etc/default/login"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4601 | AC_DEFINE([HAVE_ETC_DEFAULT_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4602 | [Define if your system has /etc/default/login]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4603 | fi |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4604 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4605 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4606 | 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] | 4607 | if test $ac_cv_func_login_getcapbool = "yes" && \ |
| 4608 | test $ac_cv_header_login_cap_h = "yes" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4609 | external_path_file=/etc/login.conf |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4610 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4611 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4612 | # Whether to mess with the default path |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4613 | SERVER_PATH_MSG="(default)" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4614 | AC_ARG_WITH([default-path], |
Tim Rice | 6397eed | 2015-06-03 21:41:11 -0700 | [diff] [blame] | 4615 | [ --with-default-path= Specify default $PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4616 | [ |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4617 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4618 | AC_MSG_WARN([ |
| 4619 | --with-default-path=PATH has no effect on this system. |
| 4620 | Edit /etc/login.conf instead.]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4621 | elif test "x$withval" != "xno" ; then |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4622 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4623 | AC_MSG_WARN([ |
| 4624 | --with-default-path=PATH will only be used if PATH is not defined in |
| 4625 | $external_path_file .]) |
| 4626 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4627 | user_path="$withval" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4628 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4629 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4630 | ], |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4631 | [ if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 4632 | 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] | 4633 | else |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4634 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4635 | AC_MSG_WARN([ |
| 4636 | If PATH is defined in $external_path_file, ensure the path to scp is included, |
| 4637 | otherwise scp will not work.]) |
| 4638 | fi |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4639 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4640 | [AC_LANG_PROGRAM([[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4641 | /* find out what STDPATH is */ |
| 4642 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4643 | #ifdef HAVE_PATHS_H |
| 4644 | # include <paths.h> |
| 4645 | #endif |
| 4646 | #ifndef _PATH_STDPATH |
Tim Rice | 1c9e688 | 2002-11-22 13:29:01 -0800 | [diff] [blame] | 4647 | # ifdef _PATH_USERPATH /* Irix */ |
| 4648 | # define _PATH_STDPATH _PATH_USERPATH |
| 4649 | # else |
| 4650 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 4651 | # endif |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4652 | #endif |
| 4653 | #include <sys/types.h> |
| 4654 | #include <sys/stat.h> |
| 4655 | #include <fcntl.h> |
| 4656 | #define DATA "conftest.stdpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4657 | ]], [[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4658 | FILE *fd; |
| 4659 | int rc; |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4660 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4661 | fd = fopen(DATA,"w"); |
| 4662 | if(fd == NULL) |
| 4663 | exit(1); |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4664 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4665 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 4666 | exit(1); |
| 4667 | |
| 4668 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4669 | ]])], |
| 4670 | [ user_path=`cat conftest.stdpath` ], |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4671 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 4672 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 4673 | ) |
| 4674 | # make sure $bindir is in USER_PATH so scp will work |
Damien Miller | 77eab7b | 2012-07-06 11:49:28 +1000 | [diff] [blame] | 4675 | t_bindir="${bindir}" |
| 4676 | while echo "${t_bindir}" | egrep '\$\{|NONE/' >/dev/null 2>&1; do |
| 4677 | t_bindir=`eval echo ${t_bindir}` |
| 4678 | case $t_bindir in |
| 4679 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 4680 | esac |
| 4681 | case $t_bindir in |
| 4682 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 4683 | esac |
| 4684 | done |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4685 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 4686 | if test $? -ne 0 ; then |
| 4687 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 4688 | if test $? -ne 0 ; then |
| 4689 | user_path=$user_path:$t_bindir |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4690 | 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] | 4691 | fi |
| 4692 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4693 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4694 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4695 | if test "x$external_path_file" != "x/etc/login.conf" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4696 | AC_DEFINE_UNQUOTED([USER_PATH], ["$user_path"], [Specify default $PATH]) |
| 4697 | AC_SUBST([user_path]) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4698 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4699 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4700 | # Set superuser path separately to user path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4701 | AC_ARG_WITH([superuser-path], |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4702 | [ --with-superuser-path= Specify different path for super-user], |
| 4703 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4704 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4705 | test "x${withval}" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4706 | AC_DEFINE_UNQUOTED([SUPERUSER_PATH], ["$withval"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4707 | [Define if you want a different $PATH |
| 4708 | for the superuser]) |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4709 | superuser_path=$withval |
| 4710 | fi |
| 4711 | ] |
| 4712 | ) |
| 4713 | |
| 4714 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4715 | 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] | 4716 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4717 | AC_ARG_WITH(4in6, |
| 4718 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 4719 | [ |
| 4720 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4721 | AC_MSG_RESULT([yes]) |
| 4722 | AC_DEFINE([IPV4_IN_IPV6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4723 | [Detect IPv4 in IPv6 mapped addresses |
| 4724 | and treat as IPv4]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4725 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4726 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4727 | AC_MSG_RESULT([no]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4728 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4729 | ], [ |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4730 | if test "x$inet6_default_4in6" = "xyes"; then |
| 4731 | AC_MSG_RESULT([yes (default)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4732 | AC_DEFINE([IPV4_IN_IPV6]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4733 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4734 | else |
| 4735 | AC_MSG_RESULT([no (default)]) |
| 4736 | fi |
| 4737 | ] |
| 4738 | ) |
| 4739 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4740 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4741 | BSD_AUTH_MSG=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4742 | AC_ARG_WITH([bsd-auth], |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4743 | [ --with-bsd-auth Enable BSD auth support], |
| 4744 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4745 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4746 | AC_DEFINE([BSD_AUTH], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4747 | [Define if you have BSD auth support]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4748 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4749 | fi |
| 4750 | ] |
| 4751 | ) |
| 4752 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4753 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 4754 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4755 | # make sure the directory exists |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4756 | if test ! -d $piddir ; then |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4757 | piddir=`eval echo ${sysconfdir}` |
| 4758 | case $piddir in |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4759 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4760 | esac |
| 4761 | fi |
| 4762 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4763 | AC_ARG_WITH([pid-dir], |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4764 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 4765 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4766 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4767 | test "x${withval}" != "xyes"; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4768 | piddir=$withval |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4769 | if test ! -d $piddir ; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4770 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 4771 | fi |
| 4772 | fi |
| 4773 | ] |
| 4774 | ) |
| 4775 | |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4776 | AC_DEFINE_UNQUOTED([_PATH_SSH_PIDDIR], ["$piddir"], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4777 | [Specify location of ssh.pid]) |
| 4778 | AC_SUBST([piddir]) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 4779 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4780 | dnl allow user to disable some login recording features |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4781 | AC_ARG_ENABLE([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4782 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4783 | [ |
| 4784 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4785 | AC_DEFINE([DISABLE_LASTLOG]) |
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([utmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4790 | [ --disable-utmp disable use of utmp even if detected [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_UTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4794 | fi |
| 4795 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4796 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4797 | AC_ARG_ENABLE([utmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4798 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4799 | [ |
| 4800 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4801 | AC_DEFINE([DISABLE_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4802 | [Define if you don't want to use utmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4803 | fi |
| 4804 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4805 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4806 | AC_ARG_ENABLE([wtmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4807 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4808 | [ |
| 4809 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4810 | AC_DEFINE([DISABLE_WTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4811 | fi |
| 4812 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4813 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4814 | AC_ARG_ENABLE([wtmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4815 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4816 | [ |
| 4817 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4818 | AC_DEFINE([DISABLE_WTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4819 | [Define if you don't want to use wtmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4820 | fi |
| 4821 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4822 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4823 | AC_ARG_ENABLE([libutil], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4824 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4825 | [ |
| 4826 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4827 | AC_DEFINE([DISABLE_LOGIN]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4828 | fi |
| 4829 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4830 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4831 | AC_ARG_ENABLE([pututline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4832 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4833 | [ |
| 4834 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4835 | AC_DEFINE([DISABLE_PUTUTLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4836 | [Define if you don't want to use pututline() |
| 4837 | etc. to write [uw]tmp]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4838 | fi |
| 4839 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4840 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4841 | AC_ARG_ENABLE([pututxline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4842 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4843 | [ |
| 4844 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4845 | AC_DEFINE([DISABLE_PUTUTXLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4846 | [Define if you don't want to use pututxline() |
| 4847 | etc. to write [uw]tmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4848 | fi |
| 4849 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4850 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4851 | AC_ARG_WITH([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4852 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4853 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4854 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4855 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4856 | elif test -n "$withval" && test "x${withval}" != "xyes"; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4857 | conf_lastlog_location=$withval |
| 4858 | fi |
| 4859 | ] |
| 4860 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4861 | |
| 4862 | dnl lastlog, [uw]tmpx? detection |
| 4863 | dnl NOTE: set the paths in the platform section to avoid the |
| 4864 | dnl need for command-line parameters |
| 4865 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 4866 | |
| 4867 | dnl lastlog detection |
| 4868 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 4869 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4870 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4871 | #include <sys/types.h> |
| 4872 | #include <utmp.h> |
| 4873 | #ifdef HAVE_LASTLOG_H |
| 4874 | # include <lastlog.h> |
| 4875 | #endif |
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 |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 4879 | #ifdef HAVE_LOGIN_H |
| 4880 | # include <login.h> |
| 4881 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4882 | ]], [[ char *lastlog = LASTLOG_FILE; ]])], |
| 4883 | [ AC_MSG_RESULT([yes]) ], |
| 4884 | [ |
| 4885 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4886 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4887 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4888 | #include <sys/types.h> |
| 4889 | #include <utmp.h> |
| 4890 | #ifdef HAVE_LASTLOG_H |
| 4891 | # include <lastlog.h> |
| 4892 | #endif |
| 4893 | #ifdef HAVE_PATHS_H |
| 4894 | # include <paths.h> |
| 4895 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4896 | ]], [[ char *lastlog = _PATH_LASTLOG; ]])], |
| 4897 | [ AC_MSG_RESULT([yes]) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4898 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4899 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4900 | system_lastlog_path=no |
| 4901 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4902 | ]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4903 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4904 | if test -z "$conf_lastlog_location"; then |
| 4905 | if test x"$system_lastlog_path" = x"no" ; then |
| 4906 | 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] | 4907 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4908 | conf_lastlog_location=$f |
| 4909 | fi |
| 4910 | done |
| 4911 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 4912 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 4913 | 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] | 4914 | fi |
| 4915 | fi |
| 4916 | fi |
| 4917 | |
| 4918 | if test -n "$conf_lastlog_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4919 | AC_DEFINE_UNQUOTED([CONF_LASTLOG_FILE], ["$conf_lastlog_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4920 | [Define if you want to specify the path to your lastlog file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4921 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4922 | |
| 4923 | dnl utmp detection |
| 4924 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4925 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4926 | #include <sys/types.h> |
| 4927 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4928 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4929 | # include <paths.h> |
| 4930 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4931 | ]], [[ char *utmp = UTMP_FILE; ]])], |
| 4932 | [ AC_MSG_RESULT([yes]) ], |
| 4933 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4934 | system_utmp_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4935 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4936 | if test -z "$conf_utmp_location"; then |
| 4937 | if test x"$system_utmp_path" = x"no" ; then |
| 4938 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 4939 | if test -f $f ; then |
| 4940 | conf_utmp_location=$f |
| 4941 | fi |
| 4942 | done |
| 4943 | if test -z "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4944 | AC_DEFINE([DISABLE_UTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4945 | fi |
| 4946 | fi |
| 4947 | fi |
| 4948 | if test -n "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4949 | AC_DEFINE_UNQUOTED([CONF_UTMP_FILE], ["$conf_utmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4950 | [Define if you want to specify the path to your utmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4951 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4952 | |
| 4953 | dnl wtmp detection |
| 4954 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4955 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4956 | #include <sys/types.h> |
| 4957 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4958 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4959 | # include <paths.h> |
| 4960 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4961 | ]], [[ char *wtmp = WTMP_FILE; ]])], |
| 4962 | [ AC_MSG_RESULT([yes]) ], |
| 4963 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4964 | system_wtmp_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4965 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4966 | if test -z "$conf_wtmp_location"; then |
| 4967 | if test x"$system_wtmp_path" = x"no" ; then |
| 4968 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 4969 | if test -f $f ; then |
| 4970 | conf_wtmp_location=$f |
| 4971 | fi |
| 4972 | done |
| 4973 | if test -z "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4974 | AC_DEFINE([DISABLE_WTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4975 | fi |
| 4976 | fi |
| 4977 | fi |
| 4978 | if test -n "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4979 | AC_DEFINE_UNQUOTED([CONF_WTMP_FILE], ["$conf_wtmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4980 | [Define if you want to specify the path to your wtmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4981 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4982 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4983 | dnl wtmpx detection |
| 4984 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4985 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4986 | #include <sys/types.h> |
| 4987 | #include <utmp.h> |
| 4988 | #ifdef HAVE_UTMPX_H |
| 4989 | #include <utmpx.h> |
| 4990 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4991 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4992 | # include <paths.h> |
| 4993 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4994 | ]], [[ char *wtmpx = WTMPX_FILE; ]])], |
| 4995 | [ AC_MSG_RESULT([yes]) ], |
| 4996 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4997 | system_wtmpx_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4998 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4999 | if test -z "$conf_wtmpx_location"; then |
| 5000 | if test x"$system_wtmpx_path" = x"no" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5001 | AC_DEFINE([DISABLE_WTMPX]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5002 | fi |
| 5003 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5004 | AC_DEFINE_UNQUOTED([CONF_WTMPX_FILE], ["$conf_wtmpx_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 5005 | [Define if you want to specify the path to your wtmpx file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 5006 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5007 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 5008 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 5009 | if test ! -z "$blibpath" ; then |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 5010 | LDFLAGS="$LDFLAGS $blibflags$blibpath" |
| 5011 | AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 5012 | fi |
| 5013 | |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 5014 | AC_CHECK_MEMBER([struct lastlog.ll_line], [], [ |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 5015 | if test x$SKIP_DISABLE_LASTLOG_DEFINE != "xyes" ; then |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 5016 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 5017 | fi |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 5018 | ], [ |
| 5019 | #ifdef HAVE_SYS_TYPES_H |
| 5020 | #include <sys/types.h> |
| 5021 | #endif |
| 5022 | #ifdef HAVE_UTMP_H |
| 5023 | #include <utmp.h> |
| 5024 | #endif |
| 5025 | #ifdef HAVE_UTMPX_H |
| 5026 | #include <utmpx.h> |
| 5027 | #endif |
| 5028 | #ifdef HAVE_LASTLOG_H |
| 5029 | #include <lastlog.h> |
| 5030 | #endif |
| 5031 | ]) |
| 5032 | |
| 5033 | AC_CHECK_MEMBER([struct utmp.ut_line], [], [ |
| 5034 | AC_DEFINE([DISABLE_UTMP]) |
| 5035 | AC_DEFINE([DISABLE_WTMP]) |
| 5036 | ], [ |
| 5037 | #ifdef HAVE_SYS_TYPES_H |
| 5038 | #include <sys/types.h> |
| 5039 | #endif |
| 5040 | #ifdef HAVE_UTMP_H |
| 5041 | #include <utmp.h> |
| 5042 | #endif |
| 5043 | #ifdef HAVE_UTMPX_H |
| 5044 | #include <utmpx.h> |
| 5045 | #endif |
| 5046 | #ifdef HAVE_LASTLOG_H |
| 5047 | #include <lastlog.h> |
| 5048 | #endif |
| 5049 | ]) |
| 5050 | |
Darren Tucker | 7da23cb | 2005-08-03 00:20:15 +1000 | [diff] [blame] | 5051 | dnl Adding -Werror to CFLAGS early prevents configure tests from running. |
| 5052 | dnl Add now. |
| 5053 | CFLAGS="$CFLAGS $werror_flags" |
| 5054 | |
Darren Tucker | 627337d | 2010-04-10 22:58:01 +1000 | [diff] [blame] | 5055 | if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then |
| 5056 | TEST_SSH_IPV6=no |
| 5057 | else |
| 5058 | TEST_SSH_IPV6=yes |
| 5059 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5060 | AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no]) |
| 5061 | AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6]) |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 5062 | AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 5063 | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) |
Darren Tucker | 6d8bd57 | 2013-06-11 11:26:10 +1000 | [diff] [blame] | 5064 | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) |
Darren Tucker | 5d37690 | 2008-06-11 04:15:05 +1000 | [diff] [blame] | 5065 | |
Damien Miller | de35c38 | 2017-09-08 12:38:31 +1000 | [diff] [blame] | 5066 | CFLAGS="${CFLAGS} ${CFLAGS_AFTER}" |
| 5067 | LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}" |
| 5068 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 5069 | AC_EXEEXT |
Damien Miller | 223897a | 2006-09-12 21:54:10 +1000 | [diff] [blame] | 5070 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
| 5071 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 5072 | survey.sh]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 5073 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 5074 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5075 | # Print summary of options |
| 5076 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5077 | # Someone please show me a better way :) |
| 5078 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 5079 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 5080 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 5081 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 5082 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 5083 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5084 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5085 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 5086 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 5087 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5088 | |
| 5089 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 5090 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5091 | echo " User binaries: $B" |
| 5092 | echo " System binaries: $C" |
| 5093 | echo " Configuration files: $D" |
| 5094 | echo " Askpass program: $E" |
| 5095 | echo " Manual pages: $F" |
| 5096 | echo " PID file: $G" |
| 5097 | echo " Privilege separation chroot path: $H" |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 5098 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 5099 | echo " At runtime, sshd will use the path defined in $external_path_file" |
| 5100 | 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] | 5101 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5102 | echo " sshd default user PATH: $I" |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 5103 | if test ! -z "$external_path_file"; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 5104 | echo " (If PATH is set in $external_path_file it will be used instead. If" |
| 5105 | echo " used, ensure the path to scp is present, otherwise scp will not work.)" |
| 5106 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 5107 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 5108 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5109 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 5110 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5111 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 5112 | echo " PAM support: $PAM_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 5113 | echo " OSF SIA support: $SIA_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5114 | echo " KerberosV support: $KRB5_MSG" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 5115 | echo " SELinux support: $SELINUX_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5116 | echo " Smartcard support: $SCARD_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5117 | echo " S/KEY support: $SKEY_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5118 | echo " MD5 password support: $MD5_MSG" |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 5119 | echo " libedit support: $LIBEDIT_MSG" |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 5120 | echo " libldns support: $LDNS_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 5121 | echo " Solaris process contract support: $SPC_MSG" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 5122 | echo " Solaris project support: $SP_MSG" |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 5123 | echo " Solaris privilege support: $SPP_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 5124 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5125 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 5126 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 5127 | echo " Random number source: $RAND_MSG" |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 5128 | echo " Privsep sandbox style: $SANDBOX_STYLE" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 5129 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5130 | echo "" |
| 5131 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 5132 | echo " Host: ${host}" |
| 5133 | echo " Compiler: ${CC}" |
| 5134 | echo " Compiler flags: ${CFLAGS}" |
| 5135 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 5136 | echo " Linker flags: ${LDFLAGS}" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 5137 | echo " Libraries: ${LIBS}" |
| 5138 | if test ! -z "${SSHDLIBS}"; then |
| 5139 | echo " +for sshd: ${SSHDLIBS}" |
| 5140 | fi |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 5141 | if test ! -z "${SSHLIBS}"; then |
| 5142 | echo " +for ssh: ${SSHLIBS}" |
| 5143 | fi |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5144 | |
| 5145 | echo "" |
| 5146 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 5147 | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then |
Darren Tucker | cf59d31 | 2004-08-29 21:18:09 +1000 | [diff] [blame] | 5148 | echo "SVR4 style packages are supported with \"make package\"" |
| 5149 | echo "" |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 5150 | fi |
| 5151 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 5152 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 5153 | echo "PAM is enabled. You may need to install a PAM control file " |
| 5154 | echo "for sshd, otherwise password authentication may fail. " |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 5155 | echo "Example PAM control files can be found in the contrib/ " |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 5156 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 5157 | echo "" |
| 5158 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 5159 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 5160 | if test ! -z "$NO_PEERCHECK" ; then |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 5161 | echo "WARNING: the operating system that you are using does not" |
| 5162 | echo "appear to support getpeereid(), getpeerucred() or the" |
| 5163 | echo "SO_PEERCRED getsockopt() option. These facilities are used to" |
| 5164 | echo "enforce security checks to prevent unauthorised connections to" |
| 5165 | echo "ssh-agent. Their absence increases the risk that a malicious" |
| 5166 | echo "user can connect to your agent." |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 5167 | echo "" |
| 5168 | fi |
| 5169 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 5170 | if test "$AUDIT_MODULE" = "bsm" ; then |
| 5171 | echo "WARNING: BSM audit support is currently considered EXPERIMENTAL." |
| 5172 | echo "See the Solaris section in README.platform for details." |
| 5173 | fi |