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 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 33 | AC_PATH_PROG([AR], [ar]) |
| 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 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 82 | # Use LOGIN_PROGRAM from environment if possible |
| 83 | if test ! -z "$LOGIN_PROGRAM" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 84 | AC_DEFINE_UNQUOTED([LOGIN_PROGRAM_FALLBACK], ["$LOGIN_PROGRAM"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 85 | [If your header files don't define LOGIN_PROGRAM, |
| 86 | then use this (detected) from environment and PATH]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 87 | else |
| 88 | # Search for login |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 89 | AC_PATH_PROG([LOGIN_PROGRAM_FALLBACK], [login]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 90 | if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 91 | AC_DEFINE_UNQUOTED([LOGIN_PROGRAM_FALLBACK], ["$LOGIN_PROGRAM_FALLBACK"]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 92 | fi |
| 93 | fi |
| 94 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 95 | AC_PATH_PROG([PATH_PASSWD_PROG], [passwd]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 96 | if test ! -z "$PATH_PASSWD_PROG" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 97 | AC_DEFINE_UNQUOTED([_PATH_PASSWD_PROG], ["$PATH_PASSWD_PROG"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 98 | [Full path of your "passwd" program]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 99 | fi |
| 100 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 101 | if test -z "$LD" ; then |
| 102 | LD=$CC |
| 103 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 104 | AC_SUBST([LD]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 105 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 106 | AC_C_INLINE |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 107 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 108 | AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 109 | AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [ |
| 110 | #include <sys/types.h> |
| 111 | #include <sys/param.h> |
| 112 | #include <dev/systrace.h> |
| 113 | ]) |
| 114 | AC_CHECK_DECL([RLIMIT_NPROC], |
| 115 | [AC_DEFINE([HAVE_RLIMIT_NPROC], [], [sys/resource.h has RLIMIT_NPROC])], , [ |
| 116 | #include <sys/types.h> |
| 117 | #include <sys/resource.h> |
| 118 | ]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 119 | AC_CHECK_DECL([PR_SET_NO_NEW_PRIVS], [have_linux_no_new_privs=1], , [ |
| 120 | #include <sys/types.h> |
| 121 | #include <linux/prctl.h> |
| 122 | ]) |
Damien Miller | 868ea1e | 2014-01-17 16:47:04 +1100 | [diff] [blame] | 123 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 124 | openssl=yes |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 125 | ssh1=yes |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 126 | AC_ARG_WITH([openssl], |
| 127 | [ --without-openssl Disable use of OpenSSL; use only limited internal crypto **EXPERIMENTAL** ], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 128 | [ if test "x$withval" = "xno" ; then |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 129 | openssl=no |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 130 | ssh1=no |
| 131 | fi |
| 132 | ] |
| 133 | ) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 134 | AC_MSG_CHECKING([whether OpenSSL will be used for cryptography]) |
| 135 | if test "x$openssl" = "xyes" ; then |
| 136 | AC_MSG_RESULT([yes]) |
| 137 | AC_DEFINE_UNQUOTED([WITH_OPENSSL], [1], [use libcrypto for cryptography]) |
| 138 | else |
| 139 | AC_MSG_RESULT([no]) |
| 140 | fi |
| 141 | |
| 142 | AC_ARG_WITH([ssh1], |
| 143 | [ --without-ssh1 Disable support for SSH protocol 1], |
| 144 | [ |
| 145 | if test "x$withval" = "xno" ; then |
| 146 | ssh1=no |
| 147 | elif test "x$openssl" = "xno" ; then |
| 148 | AC_MSG_ERROR([Cannot enable SSH protocol 1 with OpenSSL disabled]) |
| 149 | fi |
| 150 | ] |
| 151 | ) |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 152 | AC_MSG_CHECKING([whether SSH protocol 1 support is enabled]) |
| 153 | if test "x$ssh1" = "xyes" ; then |
| 154 | AC_MSG_RESULT([yes]) |
| 155 | AC_DEFINE_UNQUOTED([WITH_SSH1], [1], [include SSH protocol version 1 support]) |
| 156 | else |
| 157 | AC_MSG_RESULT([no]) |
| 158 | fi |
| 159 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 160 | use_stack_protector=1 |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 161 | use_toolchain_hardening=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 162 | AC_ARG_WITH([stackprotect], |
Damien Miller | da3155e | 2008-03-27 12:30:18 +1100 | [diff] [blame] | 163 | [ --without-stackprotect Don't use compiler's stack protection], [ |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 164 | if test "x$withval" = "xno"; then |
| 165 | use_stack_protector=0 |
| 166 | fi ]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 167 | AC_ARG_WITH([hardening], |
| 168 | [ --without-hardening Don't use toolchain hardening flags], [ |
| 169 | if test "x$withval" = "xno"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 170 | use_toolchain_hardening=0 |
| 171 | fi ]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 172 | |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 173 | # We use -Werror for the tests only so that we catch warnings like "this is |
| 174 | # on by default" for things like -fPIE. |
| 175 | AC_MSG_CHECKING([if $CC supports -Werror]) |
| 176 | saved_CFLAGS="$CFLAGS" |
| 177 | CFLAGS="$CFLAGS -Werror" |
| 178 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], |
| 179 | [ AC_MSG_RESULT([yes]) |
| 180 | WERROR="-Werror"], |
| 181 | [ AC_MSG_RESULT([no]) |
| 182 | WERROR="" ] |
| 183 | ) |
| 184 | CFLAGS="$saved_CFLAGS" |
Damien Miller | 134d02a | 2011-01-12 16:00:37 +1100 | [diff] [blame] | 185 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 186 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 187 | OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) |
| 188 | OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option]) |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 189 | OSSH_CHECK_CFLAG_COMPILE([-Wall]) |
| 190 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) |
| 191 | OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) |
| 192 | OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) |
| 193 | OSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) |
Darren Tucker | abbc7a7 | 2013-05-10 13:54:23 +1000 | [diff] [blame] | 194 | OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 195 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) |
| 196 | OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) |
| 197 | OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) |
Darren Tucker | 4a725ef | 2011-11-21 16:38:48 +1100 | [diff] [blame] | 198 | OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 199 | if test "x$use_toolchain_hardening" = "x1"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 200 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,relro]) |
| 201 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,now]) |
| 202 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,noexecstack]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 203 | # NB. -ftrapv expects certain support functions to be present in |
| 204 | # the compiler library (libgcc or similar) to detect integer operations |
| 205 | # that can overflow. We must check that the result of enabling it |
| 206 | # actually links. The test program compiled/linked includes a number |
| 207 | # of integer operations that should exercise this. |
| 208 | OSSH_CHECK_CFLAG_LINK([-ftrapv]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 209 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 210 | AC_MSG_CHECKING([gcc version]) |
Darren Tucker | 3f9545e | 2005-11-12 15:20:52 +1100 | [diff] [blame] | 211 | GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 212 | case $GCC_VER in |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 213 | 1.*) no_attrib_nonnull=1 ;; |
| 214 | 2.8* | 2.9*) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 215 | no_attrib_nonnull=1 |
| 216 | ;; |
| 217 | 2.*) no_attrib_nonnull=1 ;; |
Darren Tucker | f032435 | 2005-11-10 21:30:36 +1100 | [diff] [blame] | 218 | *) ;; |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 219 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 220 | AC_MSG_RESULT([$GCC_VER]) |
Damien Miller | de3cb0a | 2005-05-26 20:48:25 +1000 | [diff] [blame] | 221 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 222 | AC_MSG_CHECKING([if $CC accepts -fno-builtin-memset]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 223 | saved_CFLAGS="$CFLAGS" |
| 224 | CFLAGS="$CFLAGS -fno-builtin-memset" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 225 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> ]], |
| 226 | [[ char b[10]; memset(b, 0, sizeof(b)); ]])], |
| 227 | [ AC_MSG_RESULT([yes]) ], |
| 228 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 229 | CFLAGS="$saved_CFLAGS" ] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 230 | ) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 231 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 232 | # -fstack-protector-all doesn't always work for some GCC versions |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 233 | # 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] | 234 | # 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] | 235 | if test "x$use_stack_protector" = "x1"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 236 | for t in -fstack-protector-strong -fstack-protector-all \ |
| 237 | -fstack-protector; do |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 238 | AC_MSG_CHECKING([if $CC supports $t]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 239 | saved_CFLAGS="$CFLAGS" |
| 240 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 241 | CFLAGS="$CFLAGS $t -Werror" |
| 242 | LDFLAGS="$LDFLAGS $t -Werror" |
| 243 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 244 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 245 | [[ |
| 246 | char x[256]; |
| 247 | snprintf(x, sizeof(x), "XXX"); |
| 248 | ]])], |
| 249 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 250 | CFLAGS="$saved_CFLAGS $t" |
| 251 | LDFLAGS="$saved_LDFLAGS $t" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 252 | AC_MSG_CHECKING([if $t works]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 253 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 254 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 255 | [[ |
| 256 | char x[256]; |
| 257 | snprintf(x, sizeof(x), "XXX"); |
| 258 | ]])], |
| 259 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 260 | break ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 261 | [ AC_MSG_RESULT([no]) ], |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 262 | [ AC_MSG_WARN([cross compiling: cannot test]) |
| 263 | break ] |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 264 | ) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 265 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 266 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 267 | ) |
| 268 | CFLAGS="$saved_CFLAGS" |
| 269 | LDFLAGS="$saved_LDFLAGS" |
| 270 | done |
| 271 | fi |
Darren Tucker | 319b3d9 | 2007-12-02 21:02:22 +1100 | [diff] [blame] | 272 | |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 273 | if test -z "$have_llong_max"; then |
| 274 | # retry LLONG_MAX with -std=gnu99, needed on some Linuxes |
| 275 | unset ac_cv_have_decl_LLONG_MAX |
| 276 | saved_CFLAGS="$CFLAGS" |
| 277 | CFLAGS="$CFLAGS -std=gnu99" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 278 | AC_CHECK_DECL([LLONG_MAX], |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 279 | [have_llong_max=1], |
| 280 | [CFLAGS="$saved_CFLAGS"], |
| 281 | [#include <limits.h>] |
| 282 | ) |
| 283 | fi |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 284 | fi |
| 285 | |
Darren Tucker | 951b53b | 2013-02-08 11:50:09 +1100 | [diff] [blame] | 286 | AC_MSG_CHECKING([if compiler allows __attribute__ on return types]) |
| 287 | AC_COMPILE_IFELSE( |
| 288 | [AC_LANG_PROGRAM([[ |
| 289 | #include <stdlib.h> |
| 290 | __attribute__((__unused__)) static void foo(void){return;}]], |
| 291 | [[ exit(0); ]])], |
| 292 | [ AC_MSG_RESULT([yes]) ], |
| 293 | [ AC_MSG_RESULT([no]) |
| 294 | AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1, |
| 295 | [compiler does not accept __attribute__ on return types]) ] |
| 296 | ) |
| 297 | |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 298 | if test "x$no_attrib_nonnull" != "x1" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 299 | AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull]) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 300 | fi |
| 301 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 302 | AC_ARG_WITH([rpath], |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 303 | [ --without-rpath Disable auto-added -R linker paths], |
| 304 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 305 | if test "x$withval" = "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 306 | need_dash_r="" |
| 307 | fi |
| 308 | if test "x$withval" = "xyes" ; then |
| 309 | need_dash_r=1 |
| 310 | fi |
| 311 | ] |
| 312 | ) |
| 313 | |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 314 | # Allow user to specify flags |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 315 | AC_ARG_WITH([cflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 316 | [ --with-cflags Specify additional flags to pass to compiler], |
| 317 | [ |
| 318 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 319 | test "x${withval}" != "xyes"; then |
| 320 | CFLAGS="$CFLAGS $withval" |
| 321 | fi |
| 322 | ] |
| 323 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 324 | AC_ARG_WITH([cppflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 325 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 326 | [ |
| 327 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 328 | test "x${withval}" != "xyes"; then |
| 329 | CPPFLAGS="$CPPFLAGS $withval" |
| 330 | fi |
| 331 | ] |
| 332 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 333 | AC_ARG_WITH([ldflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 334 | [ --with-ldflags Specify additional flags to pass to linker], |
| 335 | [ |
| 336 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 337 | test "x${withval}" != "xyes"; then |
| 338 | LDFLAGS="$LDFLAGS $withval" |
| 339 | fi |
| 340 | ] |
| 341 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 342 | AC_ARG_WITH([libs], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 343 | [ --with-libs Specify additional libraries to link with], |
| 344 | [ |
| 345 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 346 | test "x${withval}" != "xyes"; then |
| 347 | LIBS="$LIBS $withval" |
| 348 | fi |
| 349 | ] |
| 350 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 351 | AC_ARG_WITH([Werror], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 352 | [ --with-Werror Build main code with -Werror], |
| 353 | [ |
| 354 | if test -n "$withval" && test "x$withval" != "xno"; then |
| 355 | werror_flags="-Werror" |
| 356 | if test "x${withval}" != "xyes"; then |
| 357 | werror_flags="$withval" |
| 358 | fi |
| 359 | fi |
| 360 | ] |
| 361 | ) |
| 362 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 363 | AC_CHECK_HEADERS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 364 | blf.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 365 | bstring.h \ |
| 366 | crypt.h \ |
| 367 | crypto/sha2.h \ |
| 368 | dirent.h \ |
| 369 | endian.h \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 370 | elf.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 371 | features.h \ |
| 372 | fcntl.h \ |
| 373 | floatingpoint.h \ |
| 374 | getopt.h \ |
| 375 | glob.h \ |
| 376 | ia.h \ |
| 377 | iaf.h \ |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 378 | inttypes.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 379 | limits.h \ |
Darren Tucker | ae133d4 | 2013-06-06 08:30:20 +1000 | [diff] [blame] | 380 | locale.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 381 | login.h \ |
| 382 | maillock.h \ |
| 383 | ndir.h \ |
| 384 | net/if_tun.h \ |
| 385 | netdb.h \ |
| 386 | netgroup.h \ |
| 387 | pam/pam_appl.h \ |
| 388 | paths.h \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 389 | poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 390 | pty.h \ |
| 391 | readpassphrase.h \ |
| 392 | rpc/types.h \ |
| 393 | security/pam_appl.h \ |
| 394 | sha2.h \ |
| 395 | shadow.h \ |
| 396 | stddef.h \ |
| 397 | stdint.h \ |
| 398 | string.h \ |
| 399 | strings.h \ |
| 400 | sys/audit.h \ |
| 401 | sys/bitypes.h \ |
| 402 | sys/bsdtty.h \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 403 | sys/capability.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 404 | sys/cdefs.h \ |
| 405 | sys/dir.h \ |
| 406 | sys/mman.h \ |
| 407 | sys/ndir.h \ |
Darren Tucker | 7c92a65 | 2007-09-27 07:00:09 +1000 | [diff] [blame] | 408 | sys/poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 409 | sys/prctl.h \ |
| 410 | sys/pstat.h \ |
| 411 | sys/select.h \ |
| 412 | sys/stat.h \ |
| 413 | sys/stream.h \ |
| 414 | sys/stropts.h \ |
| 415 | sys/strtio.h \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 416 | sys/statvfs.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 417 | sys/sysmacros.h \ |
| 418 | sys/time.h \ |
| 419 | sys/timers.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 420 | time.h \ |
| 421 | tmpdir.h \ |
| 422 | ttyent.h \ |
Tim Rice | aa8954f | 2007-05-09 15:57:43 -0700 | [diff] [blame] | 423 | ucred.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 424 | unistd.h \ |
| 425 | usersec.h \ |
| 426 | util.h \ |
| 427 | utime.h \ |
| 428 | utmp.h \ |
| 429 | utmpx.h \ |
| 430 | vis.h \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 431 | ]) |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 432 | |
| 433 | # lastlog.h requires sys/time.h to be included first on Solaris |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 434 | AC_CHECK_HEADERS([lastlog.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 435 | #ifdef HAVE_SYS_TIME_H |
| 436 | # include <sys/time.h> |
| 437 | #endif |
| 438 | ]) |
| 439 | |
| 440 | # 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] | 441 | AC_CHECK_HEADERS([sys/ptms.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 442 | #ifdef HAVE_SYS_STREAM_H |
| 443 | # include <sys/stream.h> |
| 444 | #endif |
| 445 | ]) |
| 446 | |
| 447 | # login_cap.h requires sys/types.h on NetBSD |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 448 | AC_CHECK_HEADERS([login_cap.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 449 | #include <sys/types.h> |
| 450 | ]) |
| 451 | |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 452 | # older BSDs need sys/param.h before sys/mount.h |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 453 | AC_CHECK_HEADERS([sys/mount.h], [], [], [ |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 454 | #include <sys/param.h> |
| 455 | ]) |
| 456 | |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 457 | # Android requires sys/socket.h to be included before sys/un.h |
| 458 | AC_CHECK_HEADERS([sys/un.h], [], [], [ |
Darren Tucker | 0b43ffe | 2013-06-03 09:30:44 +1000 | [diff] [blame] | 459 | #include <sys/types.h> |
Darren Tucker | 16cac19 | 2013-06-04 12:55:24 +1000 | [diff] [blame] | 460 | #include <sys/socket.h> |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 461 | ]) |
| 462 | |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 463 | # Messages for features tested for in target-specific section |
| 464 | SIA_MSG="no" |
| 465 | SPC_MSG="no" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 466 | SP_MSG="no" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 467 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 468 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 469 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 470 | *-*-aix*) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 471 | # Some versions of VAC won't allow macro redefinitions at |
| 472 | # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that |
| 473 | # particularly with older versions of vac or xlc. |
| 474 | # It also throws errors about null macro argments, but these are |
| 475 | # not fatal. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 476 | AC_MSG_CHECKING([if compiler allows macro redefinitions]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 477 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 478 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 479 | #define testmacro foo |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 480 | #define testmacro bar]], |
| 481 | [[ exit(0); ]])], |
| 482 | [ AC_MSG_RESULT([yes]) ], |
| 483 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 484 | CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`" |
| 485 | LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`" |
| 486 | CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 487 | CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 488 | ] |
| 489 | ) |
| 490 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 491 | AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 492 | if (test -z "$blibpath"); then |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 493 | blibpath="/usr/lib:/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 494 | fi |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 495 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | bdc1212 | 2006-07-06 11:56:25 +1000 | [diff] [blame] | 496 | if test "$GCC" = "yes"; then |
| 497 | flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:" |
| 498 | else |
| 499 | flags="-blibpath: -Wl,-blibpath: -Wl,-rpath," |
| 500 | fi |
| 501 | for tryflags in $flags ;do |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 502 | if (test -z "$blibflags"); then |
| 503 | LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 504 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
| 505 | [blibflags=$tryflags], []) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 506 | fi |
| 507 | done |
| 508 | if (test -z "$blibflags"); then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 509 | AC_MSG_RESULT([not found]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 510 | AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log]) |
| 511 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 512 | AC_MSG_RESULT([$blibflags]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 513 | fi |
| 514 | LDFLAGS="$saved_LDFLAGS" |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 515 | dnl Check for authenticate. Might be in libs.a on older AIXes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 516 | AC_CHECK_FUNC([authenticate], [AC_DEFINE([WITH_AIXAUTHENTICATE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 517 | [Define if you want to enable AIX4's authenticate function])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 518 | [AC_CHECK_LIB([s], [authenticate], |
| 519 | [ AC_DEFINE([WITH_AIXAUTHENTICATE]) |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 520 | LIBS="$LIBS -ls" |
| 521 | ]) |
| 522 | ]) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 523 | dnl Check for various auth function declarations in headers. |
Darren Tucker | 04cfbe0 | 2005-02-20 23:27:11 +1100 | [diff] [blame] | 524 | AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, |
Darren Tucker | e66519d | 2005-03-21 22:46:34 +1100 | [diff] [blame] | 525 | passwdexpired, setauthdb], , , [#include <usersec.h>]) |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 526 | 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] | 527 | AC_CHECK_DECLS([loginfailed], |
| 528 | [AC_MSG_CHECKING([if loginfailed takes 4 arguments]) |
| 529 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <usersec.h> ]], |
| 530 | [[ (void)loginfailed("user","host","tty",0); ]])], |
| 531 | [AC_MSG_RESULT([yes]) |
| 532 | AC_DEFINE([AIX_LOGINFAILED_4ARG], [1], |
| 533 | [Define if your AIX loginfailed() function |
| 534 | takes 4 arguments (AIX >= 5.2)])], [AC_MSG_RESULT([no]) |
| 535 | ])], |
| 536 | [], |
| 537 | [#include <usersec.h>] |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 538 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 539 | AC_CHECK_FUNCS([getgrset setauthdb]) |
| 540 | AC_CHECK_DECL([F_CLOSEM], |
| 541 | AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]), |
Darren Tucker | 3083bc2 | 2006-08-17 19:35:49 +1000 | [diff] [blame] | 542 | [], |
| 543 | [ #include <limits.h> |
| 544 | #include <fcntl.h> ] |
| 545 | ) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 546 | check_for_aix_broken_getaddrinfo=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 547 | AC_DEFINE([BROKEN_REALPATH], [1], [Define if you have a broken realpath.]) |
| 548 | AC_DEFINE([SETEUID_BREAKS_SETUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 549 | [Define if your platform breaks doing a seteuid before a setuid]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 550 | AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken]) |
| 551 | AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken]) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 552 | dnl AIX handles lastlog as part of its login message |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 553 | AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog]) |
| 554 | AC_DEFINE([LOGIN_NEEDS_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 555 | [Some systems need a utmpx entry for /bin/login to work]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 556 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 557 | [Define to a Set Process Title type if your system is |
| 558 | supported by bsd-setproctitle.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 559 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Darren Tucker | 91d25a0 | 2005-11-26 22:24:09 +1100 | [diff] [blame] | 560 | [AIX 5.2 and 5.3 (and presumably newer) require this]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 561 | 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] | 562 | 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] | 563 | ;; |
Darren Tucker | 898ac93 | 2013-06-03 02:03:25 +1000 | [diff] [blame] | 564 | *-*-android*) |
| 565 | AC_DEFINE([DISABLE_UTMP], [1], [Define if you don't want to use utmp]) |
| 566 | AC_DEFINE([DISABLE_WTMP], [1], [Define if you don't want to use wtmp]) |
| 567 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 568 | *-*-cygwin*) |
Damien Miller | c8936ac | 2003-02-11 10:04:03 +1100 | [diff] [blame] | 569 | check_for_libcrypt_later=1 |
Darren Tucker | 573e387 | 2007-03-02 17:50:03 +1100 | [diff] [blame] | 570 | LIBS="$LIBS /usr/lib/textreadmode.o" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 571 | AC_DEFINE([HAVE_CYGWIN], [1], [Define if you are on Cygwin]) |
| 572 | AC_DEFINE([USE_PIPES], [1], [Use PIPES instead of a socketpair()]) |
| 573 | AC_DEFINE([DISABLE_SHADOW], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 574 | [Define if you want to disable shadow passwords]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 575 | AC_DEFINE([NO_X11_UNIX_SOCKETS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 576 | [Define if X11 doesn't support AF_UNIX sockets on that system]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 577 | AC_DEFINE([NO_IPPORT_RESERVED_CONCEPT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 578 | [Define if the concept of ports only accessible to |
| 579 | superusers isn't known]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 580 | AC_DEFINE([DISABLE_FD_PASSING], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 581 | [Define if your platform needs to skip post auth |
| 582 | file descriptor passing]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 583 | AC_DEFINE([SSH_IOBUFSZ], [65535], [Windows is sensitive to read buffer size]) |
Darren Tucker | fdce373 | 2014-01-18 21:12:42 +1100 | [diff] [blame] | 584 | AC_DEFINE([FILESYSTEM_NO_BACKSLASH], [1], [File names may not contain backslash characters]) |
| 585 | # Cygwin defines optargs, optargs as declspec(dllimport) for historical |
| 586 | # reasons which cause compile warnings, so we disable those warnings. |
| 587 | OSSH_CHECK_CFLAG_COMPILE([-Wno-attributes]) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 588 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 589 | *-*-dgux*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 590 | AC_DEFINE([IP_TOS_IS_BROKEN], [1], |
Tim Rice | a74000e | 2009-03-18 11:25:02 -0700 | [diff] [blame] | 591 | [Define if your system choked on IP TOS setting]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 592 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 593 | AC_DEFINE([BROKEN_SETREUID]) |
| 594 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 595 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 596 | *-*-darwin*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 597 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 598 | AC_MSG_CHECKING([if we have working getaddrinfo]) |
| 599 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 600 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
| 601 | exit(0); |
| 602 | else |
| 603 | exit(1); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 604 | } |
| 605 | ]])], |
| 606 | [AC_MSG_RESULT([working])], |
| 607 | [AC_MSG_RESULT([buggy]) |
| 608 | AC_DEFINE([BROKEN_GETADDRINFO], [1], |
| 609 | [getaddrinfo is broken (if present)]) |
| 610 | ], |
| 611 | [AC_MSG_RESULT([assume it is working])]) |
| 612 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 613 | AC_DEFINE([BROKEN_SETREUID]) |
| 614 | AC_DEFINE([BROKEN_SETREGID]) |
| 615 | AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect]) |
| 616 | AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 617 | [Define if your resolver libs need this for getrrsetbyname]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 618 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
| 619 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 620 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 621 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 622 | [Prepend the address family to IP tunnel traffic]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 623 | m4_pattern_allow([AU_IPv]) |
| 624 | AC_CHECK_DECL([AU_IPv4], [], |
| 625 | AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 626 | [#include <bsm/audit.h>] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 627 | AC_DEFINE([LASTLOG_WRITE_PUTUTXLINE], [1], |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 628 | [Define if pututxline updates lastlog too]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 629 | ) |
Damien Miller | c09182f | 2011-06-03 12:11:38 +1000 | [diff] [blame] | 630 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
| 631 | [Define to a Set Process Title type if your system is |
| 632 | supported by bsd-setproctitle.c]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 633 | AC_CHECK_FUNCS([sandbox_init]) |
| 634 | AC_CHECK_HEADERS([sandbox.h]) |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 635 | ;; |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 636 | *-*-dragonfly*) |
| 637 | SSHDLIBS="$SSHDLIBS -lcrypt" |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 638 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 639 | ;; |
Darren Tucker | a83d90f | 2010-03-26 10:27:33 +1100 | [diff] [blame] | 640 | *-*-haiku*) |
| 641 | LIBS="$LIBS -lbsd " |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 642 | AC_CHECK_LIB([network], [socket]) |
| 643 | AC_DEFINE([HAVE_U_INT64_T]) |
Darren Tucker | a83d90f | 2010-03-26 10:27:33 +1100 | [diff] [blame] | 644 | MANTYPE=man |
| 645 | ;; |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 646 | *-*-hpux*) |
| 647 | # 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] | 648 | 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] | 649 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 650 | AC_DEFINE([USE_PIPES]) |
| 651 | AC_DEFINE([LOGIN_NO_ENDOPT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 652 | [Define if your login program cannot handle end of options ("--")]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 653 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
| 654 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 655 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 656 | AC_DEFINE([SPT_TYPE], [SPT_PSTAT]) |
Darren Tucker | aa97d13 | 2013-03-12 11:31:05 +1100 | [diff] [blame] | 657 | 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] | 658 | maildir="/var/mail" |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 659 | LIBS="$LIBS -lsec" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 660 | AC_CHECK_LIB([xnet], [t_error], , |
| 661 | [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 662 | |
| 663 | # next, we define all of the options specific to major releases |
| 664 | case "$host" in |
| 665 | *-*-hpux10*) |
| 666 | if test -z "$GCC"; then |
| 667 | CFLAGS="$CFLAGS -Ae" |
| 668 | fi |
| 669 | ;; |
| 670 | *-*-hpux11*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 671 | AC_DEFINE([PAM_SUN_CODEBASE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 672 | [Define if you are using Solaris-derived PAM which |
| 673 | passes pam_messages to the conversation function |
| 674 | with an extra level of indirection]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 675 | AC_DEFINE([DISABLE_UTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 676 | [Define if you don't want to use utmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 677 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 678 | check_for_hpux_broken_getaddrinfo=1 |
| 679 | check_for_conflicting_getspnam=1 |
| 680 | ;; |
| 681 | esac |
| 682 | |
| 683 | # lastly, we define options specific to minor releases |
| 684 | case "$host" in |
| 685 | *-*-hpux10.26) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 686 | AC_DEFINE([HAVE_SECUREWARE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 687 | [Define if you have SecureWare-based |
| 688 | protected password database]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 689 | disable_ptmx_check=yes |
| 690 | LIBS="$LIBS -lsecpw" |
| 691 | ;; |
| 692 | esac |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 693 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 694 | *-*-irix5*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 695 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 696 | AC_DEFINE([BROKEN_INET_NTOA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 697 | [Define if you system's inet_ntoa is busted |
| 698 | (e.g. Irix gcc issue)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 699 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 700 | AC_DEFINE([BROKEN_SETREUID]) |
| 701 | AC_DEFINE([BROKEN_SETREGID]) |
| 702 | AC_DEFINE([WITH_ABBREV_NO_TTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 703 | [Define if you shouldn't strip 'tty' from your |
| 704 | ttyname in [uw]tmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 705 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 706 | ;; |
| 707 | *-*-irix6*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 708 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 709 | AC_DEFINE([WITH_IRIX_ARRAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 710 | [Define if you have/want arrays |
| 711 | (cluster-wide session managment, not C arrays)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 712 | AC_DEFINE([WITH_IRIX_PROJECT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 713 | [Define if you want IRIX project management]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 714 | AC_DEFINE([WITH_IRIX_AUDIT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 715 | [Define if you want IRIX audit trails]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 716 | AC_CHECK_FUNC([jlimit_startjob], [AC_DEFINE([WITH_IRIX_JOBS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 717 | [Define if you want IRIX kernel jobs])]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 718 | AC_DEFINE([BROKEN_INET_NTOA]) |
| 719 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 720 | AC_DEFINE([BROKEN_SETREUID]) |
| 721 | AC_DEFINE([BROKEN_SETREGID]) |
| 722 | AC_DEFINE([BROKEN_UPDWTMPX], [1], [updwtmpx is broken (if present)]) |
| 723 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 724 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 725 | ;; |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 726 | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) |
| 727 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 728 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 729 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"]) |
| 730 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 731 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 732 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 733 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 734 | *-*-linux*) |
| 735 | no_dev_ptmx=1 |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 736 | use_pie=auto |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 737 | check_for_libcrypt_later=1 |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 738 | check_for_openpty_ctty_bug=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 739 | AC_DEFINE([PAM_TTY_KLUDGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 740 | [Work around problematic Linux PAM modules handling of PAM_TTY]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 741 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 742 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 743 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 744 | AC_DEFINE([LINK_OPNOTSUPP_ERRNO], [EPERM], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 745 | [Define to whatever link() returns for "not supported" |
| 746 | if it doesn't return EOPNOTSUPP.]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 747 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 748 | AC_DEFINE([USE_BTMP]) |
| 749 | AC_DEFINE([LINUX_OOM_ADJUST], [1], [Adjust Linux out-of-memory killer]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 750 | inet6_default_4in6=yes |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 751 | case `uname -r` in |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 752 | 1.*|2.0.*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 753 | AC_DEFINE([BROKEN_CMSG_TYPE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 754 | [Define if cmsg_type is not passed correctly]) |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 755 | ;; |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 756 | esac |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 757 | # tun(4) forwarding compat code |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 758 | AC_CHECK_HEADERS([linux/if_tun.h]) |
Damien Miller | bd4e410 | 2006-01-01 21:03:30 +1100 | [diff] [blame] | 759 | if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 760 | AC_DEFINE([SSH_TUN_LINUX], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 761 | [Open tunnel devices the Linux tun/tap way]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 762 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 763 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 764 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 765 | [Prepend the address family to IP tunnel traffic]) |
| 766 | fi |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 767 | AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h], [], |
| 768 | [], [#include <linux/types.h>]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 769 | AC_CHECK_FUNCS([prctl]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 770 | AC_MSG_CHECKING([for seccomp architecture]) |
| 771 | seccomp_audit_arch= |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 772 | case "$host" in |
| 773 | x86_64-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 774 | seccomp_audit_arch=AUDIT_ARCH_X86_64 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 775 | ;; |
| 776 | i*86-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 777 | seccomp_audit_arch=AUDIT_ARCH_I386 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 778 | ;; |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 779 | arm*-*) |
| 780 | seccomp_audit_arch=AUDIT_ARCH_ARM |
| 781 | ;; |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 782 | esac |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 783 | if test "x$seccomp_audit_arch" != "x" ; then |
| 784 | AC_MSG_RESULT(["$seccomp_audit_arch"]) |
| 785 | AC_DEFINE_UNQUOTED([SECCOMP_AUDIT_ARCH], [$seccomp_audit_arch], |
| 786 | [Specify the system call convention in use]) |
| 787 | else |
| 788 | AC_MSG_RESULT([architecture not supported]) |
| 789 | fi |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 790 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 791 | mips-sony-bsd|mips-sony-newsos4) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 792 | AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to acquire controlling tty]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 793 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 794 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 795 | *-*-netbsd*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 796 | check_for_libcrypt_before=1 |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 797 | if test "x$withval" != "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 798 | need_dash_r=1 |
| 799 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 800 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 801 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 802 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 803 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 804 | [Prepend the address family to IP tunnel traffic]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 805 | TEST_MALLOC_OPTIONS="AJRX" |
Darren Tucker | 42a0925 | 2014-01-23 23:14:39 +1100 | [diff] [blame] | 806 | AC_DEFINE([BROKEN_STRNVIS], [1], |
| 807 | [NetBSD strnvis argument order is swapped compared to OpenBSD]) |
Damien Miller | f5bbd3b | 2014-01-30 11:26:46 +1100 | [diff] [blame] | 808 | AC_DEFINE([BROKEN_READ_COMPARISON], [1], |
| 809 | [NetBSD read function is sometimes redirected, breaking atomicio comparisons against it]) |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 810 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 811 | *-*-freebsd*) |
| 812 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 813 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["*LOCKED*"], [Account locked with pw(1)]) |
| 814 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 815 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 816 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 817 | AC_DEFINE([BROKEN_GLOB], [1], [FreeBSD glob does not do what we need]) |
Darren Tucker | 42a0925 | 2014-01-23 23:14:39 +1100 | [diff] [blame] | 818 | AC_DEFINE([BROKEN_STRNVIS], [1], |
| 819 | [FreeBSD strnvis argument order is swapped compared to OpenBSD]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 820 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | 2035b22 | 2014-01-26 09:39:53 +1100 | [diff] [blame] | 821 | # Preauth crypto occasionally uses file descriptors for crypto offload |
| 822 | # and will crash if they cannot be opened. |
Damien Miller | 5b447c0 | 2014-01-26 09:46:53 +1100 | [diff] [blame] | 823 | AC_DEFINE([SANDBOX_SKIP_RLIMIT_NOFILE], [1], |
Tim Rice | 03ae081 | 2014-02-21 09:09:34 -0800 | [diff] [blame] | 824 | [define if setrlimit RLIMIT_NOFILE breaks things]) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 825 | ;; |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 826 | *-*-bsdi*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 827 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 828 | AC_DEFINE([BROKEN_SETREUID]) |
| 829 | AC_DEFINE([BROKEN_SETREGID]) |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 830 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 831 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 832 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 833 | conf_utmp_location=/etc/utmp |
| 834 | conf_wtmp_location=/usr/adm/wtmp |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 835 | maildir=/usr/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 836 | AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) |
| 837 | AC_DEFINE([BROKEN_REALPATH]) |
| 838 | AC_DEFINE([USE_PIPES]) |
| 839 | AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 840 | ;; |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 841 | *-*-openbsd*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 842 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 843 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) |
| 844 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) |
| 845 | AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) |
| 846 | AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1], |
Damien Miller | bb59814 | 2006-08-19 08:38:23 +1000 | [diff] [blame] | 847 | [syslog_r function is safe to use in in a signal handler]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 848 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 849 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 850 | *-*-solaris*) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 851 | if test "x$withval" != "xno" ; then |
Tim Rice | ad4a188 | 2004-02-29 15:53:37 -0800 | [diff] [blame] | 852 | need_dash_r=1 |
| 853 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 854 | AC_DEFINE([PAM_SUN_CODEBASE]) |
| 855 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
| 856 | AC_DEFINE([LOGIN_NEEDS_TERM], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 857 | [Some versions of /bin/login need the TERM supplied |
| 858 | on the commandline]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 859 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 860 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 861 | [Define if pam_chauthtok wants real uid set |
| 862 | to the unpriv'ed user]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 863 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 864 | # Pushing STREAMS modules will cause sshd to acquire a controlling tty. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 865 | AC_DEFINE([SSHD_ACQUIRES_CTTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 866 | [Define if sshd somehow reacquires a controlling TTY |
| 867 | after setsid()]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 868 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd |
Darren Tucker | 0249f93 | 2006-06-24 12:10:07 +1000 | [diff] [blame] | 869 | in case the name is longer than 8 chars]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 870 | AC_DEFINE([BROKEN_TCGETATTR_ICANON], [1], [tcgetattr with ICANON may hang]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 871 | external_path_file=/etc/default/login |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 872 | # hardwire lastlog location (can't detect it on some versions) |
| 873 | conf_lastlog_location="/var/adm/lastlog" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 874 | AC_MSG_CHECKING([for obsolete utmp and wtmp in solaris2.x]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 875 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 876 | if test "$sol2ver" -ge 8; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 877 | AC_MSG_RESULT([yes]) |
| 878 | AC_DEFINE([DISABLE_UTMP]) |
| 879 | AC_DEFINE([DISABLE_WTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 880 | [Define if you don't want to use wtmp]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 881 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 882 | AC_MSG_RESULT([no]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 883 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 884 | AC_ARG_WITH([solaris-contracts], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 885 | [ --with-solaris-contracts Enable Solaris process contracts (experimental)], |
| 886 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 887 | AC_CHECK_LIB([contract], [ct_tmpl_activate], |
| 888 | [ AC_DEFINE([USE_SOLARIS_PROCESS_CONTRACTS], [1], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 889 | [Define if you have Solaris process contracts]) |
| 890 | SSHDLIBS="$SSHDLIBS -lcontract" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 891 | SPC_MSG="yes" ], ) |
| 892 | ], |
| 893 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 894 | AC_ARG_WITH([solaris-projects], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 895 | [ --with-solaris-projects Enable Solaris projects (experimental)], |
| 896 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 897 | AC_CHECK_LIB([project], [setproject], |
| 898 | [ AC_DEFINE([USE_SOLARIS_PROJECTS], [1], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 899 | [Define if you have Solaris projects]) |
| 900 | SSHDLIBS="$SSHDLIBS -lproject" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 901 | SP_MSG="yes" ], ) |
| 902 | ], |
| 903 | ) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 904 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 905 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 906 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 907 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 908 | AC_CHECK_FUNCS([getpwanam]) |
| 909 | AC_DEFINE([PAM_SUN_CODEBASE]) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 910 | conf_utmp_location=/etc/utmp |
| 911 | conf_wtmp_location=/var/adm/wtmp |
| 912 | conf_lastlog_location=/var/adm/lastlog |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 913 | AC_DEFINE([USE_PIPES]) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 914 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 915 | *-ncr-sysv*) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 916 | LIBS="$LIBS -lc89" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 917 | AC_DEFINE([USE_PIPES]) |
| 918 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 919 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 920 | AC_DEFINE([BROKEN_SETREUID]) |
| 921 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 922 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 923 | *-sni-sysv*) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 924 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 925 | AC_CHECK_LIB([dl], [dlsym], ,) |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 926 | # -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] | 927 | AC_CHECK_LIB([resolv], [res_query], [ LIBS="$LIBS -lresolv" ]) |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 928 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 929 | AC_DEFINE([USE_PIPES]) |
| 930 | AC_DEFINE([IP_TOS_IS_BROKEN]) |
| 931 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 932 | AC_DEFINE([BROKEN_SETREUID]) |
| 933 | AC_DEFINE([BROKEN_SETREGID]) |
| 934 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 935 | external_path_file=/etc/default/login |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 936 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 937 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 938 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 939 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 940 | # 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] | 941 | *-*-sysv4.2*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 942 | AC_DEFINE([USE_PIPES]) |
| 943 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 944 | AC_DEFINE([BROKEN_SETREUID]) |
| 945 | AC_DEFINE([BROKEN_SETREGID]) |
| 946 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd]) |
| 947 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 948 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 949 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 950 | # UnixWare 7.x, OpenUNIX 8 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 951 | *-*-sysv5*) |
Tim Rice | 641ebf1 | 2010-01-17 17:05:39 -0800 | [diff] [blame] | 952 | CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 953 | AC_DEFINE([UNIXWARE_LONG_PASSWORDS], [1], [Support passwords > 8 chars]) |
| 954 | AC_DEFINE([USE_PIPES]) |
| 955 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 956 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 957 | AC_DEFINE([BROKEN_SETREUID]) |
| 958 | AC_DEFINE([BROKEN_SETREGID]) |
| 959 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 960 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 961 | case "$host" in |
| 962 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 963 | maildir=/var/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 964 | AC_DEFINE([BROKEN_LIBIAF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 965 | [ia_uinfo routines not supported by OS yet]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 966 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 967 | AC_CHECK_LIB([prot], [getluid], [ LIBS="$LIBS -lprot" |
| 968 | AC_CHECK_FUNCS([getluid setluid], , , [-lprot]) |
| 969 | AC_DEFINE([HAVE_SECUREWARE]) |
| 970 | AC_DEFINE([DISABLE_SHADOW]) |
| 971 | ], , ) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 972 | ;; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 973 | *) AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 2676791 | 2009-01-07 20:50:08 -0800 | [diff] [blame] | 974 | check_for_libcrypt_later=1 |
Tim Rice | 46259d8 | 2005-11-28 18:40:34 -0800 | [diff] [blame] | 975 | ;; |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 976 | esac |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 977 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 978 | *-*-sysv*) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 979 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 980 | # SCO UNIX and OEM versions of SCO UNIX |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 981 | *-*-sco3.2v4*) |
Tim Rice | c390c8d | 2005-03-07 01:21:37 -0800 | [diff] [blame] | 982 | AC_MSG_ERROR("This Platform is no longer supported.") |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 983 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 984 | # SCO OpenServer 5.x |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 985 | *-*-sco3.2v5*) |
Tim Rice | 89fe3f3 | 2003-01-19 20:20:24 -0800 | [diff] [blame] | 986 | if test -z "$GCC"; then |
| 987 | CFLAGS="$CFLAGS -belf" |
| 988 | fi |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 989 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 990 | no_dev_ptmx=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 991 | AC_DEFINE([USE_PIPES]) |
| 992 | AC_DEFINE([HAVE_SECUREWARE]) |
| 993 | AC_DEFINE([DISABLE_SHADOW]) |
| 994 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 995 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 996 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 997 | AC_DEFINE([BROKEN_SETREUID]) |
| 998 | AC_DEFINE([BROKEN_SETREGID]) |
| 999 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1000 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 1001 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
| 1002 | AC_CHECK_FUNCS([getluid setluid]) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 1003 | MANTYPE=man |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1004 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 1005 | SKIP_DISABLE_LASTLOG_DEFINE=yes |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1006 | ;; |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1007 | *-*-unicosmk*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1008 | AC_DEFINE([NO_SSH_LASTLOG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1009 | [Define if you don't want to use lastlog in session.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1010 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1011 | AC_DEFINE([BROKEN_SETREUID]) |
| 1012 | AC_DEFINE([BROKEN_SETREGID]) |
| 1013 | AC_DEFINE([USE_PIPES]) |
| 1014 | AC_DEFINE([DISABLE_FD_PASSING]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1015 | LDFLAGS="$LDFLAGS" |
| 1016 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 1017 | MANTYPE=cat |
Ben Lindstrom | 762104e | 2002-07-23 00:00:05 +0000 | [diff] [blame] | 1018 | ;; |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1019 | *-*-unicosmp*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1020 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1021 | AC_DEFINE([BROKEN_SETREUID]) |
| 1022 | AC_DEFINE([BROKEN_SETREGID]) |
| 1023 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1024 | AC_DEFINE([USE_PIPES]) |
| 1025 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1026 | LDFLAGS="$LDFLAGS" |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 1027 | LIBS="$LIBS -lgen -lacid -ldb" |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1028 | MANTYPE=cat |
| 1029 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 1030 | *-*-unicos*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1031 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1032 | AC_DEFINE([BROKEN_SETREUID]) |
| 1033 | AC_DEFINE([BROKEN_SETREGID]) |
| 1034 | AC_DEFINE([USE_PIPES]) |
| 1035 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 1036 | AC_DEFINE([NO_SSH_LASTLOG]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1037 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" |
| 1038 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 1039 | MANTYPE=cat |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 1040 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1041 | *-dec-osf*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1042 | AC_MSG_CHECKING([for Digital Unix SIA]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1043 | no_osfsia="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1044 | AC_ARG_WITH([osfsia], |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1045 | [ --with-osfsia Enable Digital Unix SIA], |
| 1046 | [ |
| 1047 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1048 | AC_MSG_RESULT([disabled]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1049 | no_osfsia=1 |
| 1050 | fi |
| 1051 | ], |
| 1052 | ) |
| 1053 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1054 | if test -f /etc/sia/matrix.conf; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1055 | AC_MSG_RESULT([yes]) |
| 1056 | AC_DEFINE([HAVE_OSF_SIA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1057 | [Define if you have Digital Unix Security |
| 1058 | Integration Architecture]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1059 | AC_DEFINE([DISABLE_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1060 | [Define if you don't want to use your |
| 1061 | system's login() call]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1062 | AC_DEFINE([DISABLE_FD_PASSING]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1063 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 1064 | SIA_MSG="yes" |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1065 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1066 | AC_MSG_RESULT([no]) |
| 1067 | AC_DEFINE([LOCKED_PASSWD_SUBSTR], ["Nologin"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1068 | [String used in /etc/passwd to denote locked account]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1069 | fi |
| 1070 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1071 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1072 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1073 | AC_DEFINE([BROKEN_SETREUID]) |
| 1074 | AC_DEFINE([BROKEN_SETREGID]) |
| 1075 | AC_DEFINE([BROKEN_READV_COMPARISON], [1], [Can't do comparisons on readv]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1076 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1077 | |
Tim Rice | 70335a6 | 2006-02-04 17:42:58 -0800 | [diff] [blame] | 1078 | *-*-nto-qnx*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1079 | AC_DEFINE([USE_PIPES]) |
| 1080 | AC_DEFINE([NO_X11_UNIX_SOCKETS]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1081 | AC_DEFINE([DISABLE_LASTLOG]) |
| 1082 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 1083 | AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken]) |
Tim Rice | 2f99346 | 2006-02-11 18:37:48 -0800 | [diff] [blame] | 1084 | enable_etc_default_login=no # has incompatible /etc/default/login |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1085 | case "$host" in |
| 1086 | *-*-nto-qnx6*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1087 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1088 | ;; |
| 1089 | esac |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1090 | ;; |
Darren Tucker | 2be1cbb | 2005-05-27 21:13:40 +1000 | [diff] [blame] | 1091 | |
| 1092 | *-*-ultrix*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1093 | AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) |
| 1094 | AC_DEFINE([BROKEN_MMAP], [1], [Ultrix mmap can't map files]) |
| 1095 | AC_DEFINE([NEED_SETPGRP]) |
| 1096 | 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] | 1097 | ;; |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 1098 | |
| 1099 | *-*-lynxos) |
| 1100 | CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1101 | AC_DEFINE([BROKEN_SETVBUF], [1], [LynxOS has broken setvbuf() implementation]) |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 1102 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1103 | esac |
| 1104 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1105 | AC_MSG_CHECKING([compiler and flags for sanity]) |
| 1106 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])], |
| 1107 | [ AC_MSG_RESULT([yes]) ], |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1108 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1109 | AC_MSG_RESULT([no]) |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1110 | AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1111 | ], |
| 1112 | [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1113 | ) |
| 1114 | |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1115 | dnl Checks for header files. |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1116 | # Checks for libraries. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1117 | AC_CHECK_FUNC([yp_match], , [AC_CHECK_LIB([nsl], [yp_match])]) |
| 1118 | AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])]) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1119 | |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1120 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1121 | AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [ |
| 1122 | AC_CHECK_LIB([gen], [dirname], [ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1123 | AC_CACHE_CHECK([for broken dirname], |
| 1124 | ac_cv_have_broken_dirname, [ |
| 1125 | save_LIBS="$LIBS" |
| 1126 | LIBS="$LIBS -lgen" |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1127 | AC_RUN_IFELSE( |
| 1128 | [AC_LANG_SOURCE([[ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1129 | #include <libgen.h> |
| 1130 | #include <string.h> |
| 1131 | |
| 1132 | int main(int argc, char **argv) { |
| 1133 | char *s, buf[32]; |
| 1134 | |
| 1135 | strncpy(buf,"/etc", 32); |
| 1136 | s = dirname(buf); |
| 1137 | if (!s || strncmp(s, "/", 32) != 0) { |
| 1138 | exit(1); |
| 1139 | } else { |
| 1140 | exit(0); |
| 1141 | } |
| 1142 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1143 | ]])], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1144 | [ ac_cv_have_broken_dirname="no" ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1145 | [ ac_cv_have_broken_dirname="yes" ], |
| 1146 | [ ac_cv_have_broken_dirname="no" ], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1147 | ) |
| 1148 | LIBS="$save_LIBS" |
| 1149 | ]) |
| 1150 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
| 1151 | LIBS="$LIBS -lgen" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1152 | AC_DEFINE([HAVE_DIRNAME]) |
| 1153 | AC_CHECK_HEADERS([libgen.h]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1154 | fi |
| 1155 | ]) |
| 1156 | ]) |
| 1157 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1158 | AC_CHECK_FUNC([getspnam], , |
| 1159 | [AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])]) |
| 1160 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], |
| 1161 | [Define if you have the basename function.])]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1162 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1163 | dnl zlib is required |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1164 | AC_ARG_WITH([zlib], |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1165 | [ --with-zlib=PATH Use zlib in PATH], |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1166 | [ if test "x$withval" = "xno" ; then |
| 1167 | AC_MSG_ERROR([*** zlib is required ***]) |
| 1168 | elif test "x$withval" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1169 | if test -d "$withval/lib"; then |
| 1170 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1171 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1172 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1173 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1174 | fi |
| 1175 | else |
| 1176 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1177 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1178 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1179 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1180 | fi |
| 1181 | fi |
| 1182 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1183 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1184 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1185 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1186 | fi |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1187 | fi ] |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1188 | ) |
| 1189 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1190 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) |
| 1191 | AC_CHECK_LIB([z], [deflate], , |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1192 | [ |
| 1193 | saved_CPPFLAGS="$CPPFLAGS" |
| 1194 | saved_LDFLAGS="$LDFLAGS" |
| 1195 | save_LIBS="$LIBS" |
| 1196 | dnl Check default zlib install dir |
| 1197 | if test -n "${need_dash_r}"; then |
| 1198 | LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}" |
| 1199 | else |
| 1200 | LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" |
| 1201 | fi |
| 1202 | CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" |
| 1203 | LIBS="$LIBS -lz" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1204 | AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])], |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1205 | [ |
| 1206 | AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) |
| 1207 | ] |
| 1208 | ) |
| 1209 | ] |
| 1210 | ) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1211 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1212 | AC_ARG_WITH([zlib-version-check], |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1213 | [ --without-zlib-version-check Disable zlib version check], |
| 1214 | [ if test "x$withval" = "xno" ; then |
| 1215 | zlib_check_nonfatal=1 |
| 1216 | fi |
| 1217 | ] |
| 1218 | ) |
| 1219 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1220 | AC_MSG_CHECKING([for possibly buggy zlib]) |
| 1221 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1222 | #include <stdio.h> |
Darren Tucker | c8a0f27 | 2013-03-22 12:49:14 +1100 | [diff] [blame] | 1223 | #include <stdlib.h> |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1224 | #include <zlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1225 | ]], |
| 1226 | [[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1227 | int a=0, b=0, c=0, d=0, n, v; |
| 1228 | n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); |
| 1229 | if (n != 3 && n != 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1230 | exit(1); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1231 | v = a*1000000 + b*10000 + c*100 + d; |
| 1232 | fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); |
| 1233 | |
| 1234 | /* 1.1.4 is OK */ |
| 1235 | if (a == 1 && b == 1 && c >= 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1236 | exit(0); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1237 | |
Darren Tucker | 41097ed | 2005-07-25 15:24:21 +1000 | [diff] [blame] | 1238 | /* 1.2.3 and up are OK */ |
| 1239 | if (v >= 1020300) |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1240 | exit(0); |
| 1241 | |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1242 | exit(2); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1243 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1244 | AC_MSG_RESULT([no]), |
| 1245 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1246 | if test -z "$zlib_check_nonfatal" ; then |
| 1247 | AC_MSG_ERROR([*** zlib too old - check config.log *** |
| 1248 | Your reported zlib version has known security problems. It's possible your |
| 1249 | vendor has fixed these problems without changing the version number. If you |
| 1250 | are sure this is the case, you can disable the check by running |
| 1251 | "./configure --without-zlib-version-check". |
Darren Tucker | ac1910f | 2005-07-26 12:00:42 +1000 | [diff] [blame] | 1252 | 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] | 1253 | See http://www.gzip.org/zlib/ for details.]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1254 | else |
| 1255 | AC_MSG_WARN([zlib version may have security problems]) |
| 1256 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1257 | ], |
| 1258 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1259 | ) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1260 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1261 | dnl UnixWare 2.x |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1262 | AC_CHECK_FUNC([strcasecmp], |
| 1263 | [], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1264 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1265 | AC_CHECK_FUNCS([utimes], |
| 1266 | [], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES]) |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 1267 | LIBS="$LIBS -lc89"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1268 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1269 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1270 | dnl Checks for libutil functions |
Damien Miller | b87f6b7 | 2013-02-23 09:12:23 +1100 | [diff] [blame] | 1271 | AC_CHECK_HEADERS([bsd/libutil.h libutil.h]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1272 | AC_SEARCH_LIBS([fmt_scaled], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1273 | AC_SEARCH_LIBS([scan_scaled], [util bsd]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1274 | AC_SEARCH_LIBS([login], [util bsd]) |
| 1275 | AC_SEARCH_LIBS([logout], [util bsd]) |
| 1276 | AC_SEARCH_LIBS([logwtmp], [util bsd]) |
| 1277 | AC_SEARCH_LIBS([openpty], [util bsd]) |
| 1278 | AC_SEARCH_LIBS([updwtmp], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1279 | AC_CHECK_FUNCS([fmt_scaled scan_scaled login logout openpty updwtmp logwtmp]) |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1280 | |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1281 | # On some platforms, inet_ntop may be found in libresolv or libnsl. |
| 1282 | AC_SEARCH_LIBS([inet_ntop], [resolv nsl]) |
| 1283 | |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 1284 | AC_FUNC_STRFTIME |
| 1285 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1286 | # Check for ALTDIRFUNC glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1287 | AC_MSG_CHECKING([for GLOB_ALTDIRFUNC support]) |
| 1288 | AC_EGREP_CPP([FOUNDIT], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1289 | [ |
| 1290 | #include <glob.h> |
| 1291 | #ifdef GLOB_ALTDIRFUNC |
| 1292 | FOUNDIT |
| 1293 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1294 | ], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1295 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1296 | AC_DEFINE([GLOB_HAS_ALTDIRFUNC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1297 | [Define if your system glob() function has |
| 1298 | the GLOB_ALTDIRFUNC extension]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1299 | AC_MSG_RESULT([yes]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1300 | ], |
| 1301 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1302 | AC_MSG_RESULT([no]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1303 | ] |
| 1304 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1305 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1306 | # Check for g.gl_matchc glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1307 | AC_MSG_CHECKING([for gl_matchc field in glob_t]) |
| 1308 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], |
| 1309 | [[ glob_t g; g.gl_matchc = 1; ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1310 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1311 | AC_DEFINE([GLOB_HAS_GL_MATCHC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1312 | [Define if your system glob() function has |
| 1313 | gl_matchc options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1314 | AC_MSG_RESULT([yes]) |
| 1315 | ], [ |
| 1316 | AC_MSG_RESULT([no]) |
| 1317 | ]) |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1318 | |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1319 | # Check for g.gl_statv glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1320 | AC_MSG_CHECKING([for gl_statv and GLOB_KEEPSTAT extensions for glob]) |
| 1321 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], [[ |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1322 | #ifndef GLOB_KEEPSTAT |
| 1323 | #error "glob does not support GLOB_KEEPSTAT extension" |
| 1324 | #endif |
| 1325 | glob_t g; |
| 1326 | g.gl_statv = NULL; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1327 | ]])], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1328 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1329 | AC_DEFINE([GLOB_HAS_GL_STATV], [1], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1330 | [Define if your system glob() function has |
| 1331 | gl_statv options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1332 | AC_MSG_RESULT([yes]) |
| 1333 | ], [ |
| 1334 | AC_MSG_RESULT([no]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1335 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1336 | ]) |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1337 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1338 | AC_CHECK_DECLS([GLOB_NOMATCH], , , [#include <glob.h>]) |
Darren Tucker | 096faec | 2006-09-01 20:29:10 +1000 | [diff] [blame] | 1339 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1340 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1341 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1342 | [AC_LANG_PROGRAM([[ |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1343 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1344 | #include <dirent.h>]], |
| 1345 | [[ |
| 1346 | struct dirent d; |
| 1347 | exit(sizeof(d.d_name)<=sizeof(char)); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1348 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1349 | [AC_MSG_RESULT([yes])], |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1350 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1351 | AC_MSG_RESULT([no]) |
| 1352 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1], |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 1353 | [Define if your struct dirent expects you to |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1354 | allocate extra space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1355 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1356 | [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1357 | AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1358 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1359 | ] |
| 1360 | ) |
| 1361 | |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1362 | AC_MSG_CHECKING([for /proc/pid/fd directory]) |
| 1363 | if test -d "/proc/$$/fd" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1364 | AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd]) |
| 1365 | AC_MSG_RESULT([yes]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1366 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1367 | AC_MSG_RESULT([no]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1368 | fi |
| 1369 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1370 | # Check whether user wants S/Key support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1371 | SKEY_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1372 | AC_ARG_WITH([skey], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1373 | [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1374 | [ |
| 1375 | if test "x$withval" != "xno" ; then |
| 1376 | |
| 1377 | if test "x$withval" != "xyes" ; then |
| 1378 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1379 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1380 | fi |
| 1381 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1382 | AC_DEFINE([SKEY], [1], [Define if you want S/Key support]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1383 | LIBS="-lskey $LIBS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1384 | SKEY_MSG="yes" |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1385 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1386 | AC_MSG_CHECKING([for s/key support]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1387 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1388 | [AC_LANG_PROGRAM([[ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1389 | #include <stdio.h> |
| 1390 | #include <skey.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1391 | ]], [[ |
| 1392 | char *ff = skey_keyinfo(""); ff=""; |
| 1393 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1394 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1395 | [AC_MSG_RESULT([yes])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1396 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1397 | AC_MSG_RESULT([no]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1398 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 1399 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1400 | AC_MSG_CHECKING([if skeychallenge takes 4 arguments]) |
| 1401 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1402 | #include <stdio.h> |
| 1403 | #include <skey.h> |
| 1404 | ]], [[ |
| 1405 | (void)skeychallenge(NULL,"name","",0); |
| 1406 | ]])], |
| 1407 | [ |
| 1408 | AC_MSG_RESULT([yes]) |
| 1409 | AC_DEFINE([SKEYCHALLENGE_4ARG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1410 | [Define if your skeychallenge() |
| 1411 | function takes 4 arguments (NetBSD)])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1412 | [ |
| 1413 | AC_MSG_RESULT([no]) |
| 1414 | ]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1415 | fi |
| 1416 | ] |
| 1417 | ) |
| 1418 | |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1419 | # Check whether user wants to use ldns |
| 1420 | LDNS_MSG="no" |
| 1421 | AC_ARG_WITH(ldns, |
| 1422 | [ --with-ldns[[=PATH]] Use ldns for DNSSEC support (optionally in PATH)], |
| 1423 | [ |
| 1424 | if test "x$withval" != "xno" ; then |
| 1425 | |
| 1426 | if test "x$withval" != "xyes" ; then |
| 1427 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1428 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1429 | fi |
| 1430 | |
| 1431 | AC_DEFINE(HAVE_LDNS, 1, [Define if you want ldns support]) |
| 1432 | LIBS="-lldns $LIBS" |
| 1433 | LDNS_MSG="yes" |
| 1434 | |
| 1435 | AC_MSG_CHECKING([for ldns support]) |
| 1436 | AC_LINK_IFELSE( |
| 1437 | [AC_LANG_SOURCE([[ |
| 1438 | #include <stdio.h> |
| 1439 | #include <stdlib.h> |
| 1440 | #include <stdint.h> |
| 1441 | #include <ldns/ldns.h> |
| 1442 | int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); } |
| 1443 | ]]) |
| 1444 | ], |
| 1445 | [AC_MSG_RESULT(yes)], |
| 1446 | [ |
| 1447 | AC_MSG_RESULT(no) |
| 1448 | AC_MSG_ERROR([** Incomplete or missing ldns libraries.]) |
| 1449 | ]) |
| 1450 | fi |
| 1451 | ] |
| 1452 | ) |
| 1453 | |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1454 | # Check whether user wants libedit support |
| 1455 | LIBEDIT_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1456 | AC_ARG_WITH([libedit], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1457 | [ --with-libedit[[=PATH]] Enable libedit support for sftp], |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1458 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1459 | if test "x$withval" = "xyes" ; then |
Darren Tucker | 5935389 | 2012-05-19 15:24:37 +1000 | [diff] [blame] | 1460 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1461 | if test "x$PKGCONFIG" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1462 | AC_MSG_CHECKING([if $PKGCONFIG knows about libedit]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1463 | if "$PKGCONFIG" libedit; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1464 | AC_MSG_RESULT([yes]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1465 | use_pkgconfig_for_libedit=yes |
| 1466 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1467 | AC_MSG_RESULT([no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1468 | fi |
| 1469 | fi |
| 1470 | else |
Darren Tucker | c373a56 | 2005-09-22 20:15:08 +1000 | [diff] [blame] | 1471 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1472 | if test -n "${need_dash_r}"; then |
| 1473 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 1474 | else |
| 1475 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 1476 | fi |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1477 | fi |
Damien Miller | 1f78980 | 2010-10-11 22:35:22 +1100 | [diff] [blame] | 1478 | if test "x$use_pkgconfig_for_libedit" = "xyes"; then |
Darren Tucker | 8369c8e | 2013-12-05 11:00:16 +1100 | [diff] [blame] | 1479 | LIBEDIT=`$PKGCONFIG --libs libedit` |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1480 | CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" |
| 1481 | else |
| 1482 | LIBEDIT="-ledit -lcurses" |
| 1483 | fi |
| 1484 | OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1485 | AC_CHECK_LIB([edit], [el_init], |
| 1486 | [ AC_DEFINE([USE_LIBEDIT], [1], [Use libedit for sftp]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1487 | LIBEDIT_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1488 | AC_SUBST([LIBEDIT]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1489 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1490 | [ AC_MSG_ERROR([libedit not found]) ], |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1491 | [ $OTHERLIBS ] |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1492 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1493 | AC_MSG_CHECKING([if libedit version is compatible]) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1494 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1495 | [AC_LANG_PROGRAM([[ #include <histedit.h> ]], |
| 1496 | [[ |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1497 | int i = H_SETSIZE; |
| 1498 | el_init("", NULL, NULL, NULL); |
| 1499 | exit(0); |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1500 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1501 | [ AC_MSG_RESULT([yes]) ], |
| 1502 | [ AC_MSG_RESULT([no]) |
| 1503 | AC_MSG_ERROR([libedit version is not compatible]) ] |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1504 | ) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1505 | fi ] |
| 1506 | ) |
| 1507 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1508 | AUDIT_MODULE=none |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1509 | AC_ARG_WITH([audit], |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1510 | [ --with-audit=module Enable audit support (modules=debug,bsm,linux)], |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1511 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1512 | AC_MSG_CHECKING([for supported audit module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1513 | case "$withval" in |
| 1514 | bsm) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1515 | AC_MSG_RESULT([bsm]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1516 | AUDIT_MODULE=bsm |
| 1517 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1518 | AC_CHECK_HEADERS([bsm/audit.h], [], |
| 1519 | [AC_MSG_ERROR([BSM enabled and bsm/audit.h not found])], |
Darren Tucker | 6d0d6fb | 2006-09-09 01:05:21 +1000 | [diff] [blame] | 1520 | [ |
| 1521 | #ifdef HAVE_TIME_H |
| 1522 | # include <time.h> |
| 1523 | #endif |
| 1524 | ] |
| 1525 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1526 | AC_CHECK_LIB([bsm], [getaudit], [], |
| 1527 | [AC_MSG_ERROR([BSM enabled and required library not found])]) |
| 1528 | AC_CHECK_FUNCS([getaudit], [], |
| 1529 | [AC_MSG_ERROR([BSM enabled and required function not found])]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1530 | # These are optional |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1531 | AC_CHECK_FUNCS([getaudit_addr aug_get_machine]) |
| 1532 | AC_DEFINE([USE_BSM_AUDIT], [1], [Use BSM audit module]) |
Darren Tucker | 1fcec9d | 2013-12-19 11:00:12 +1100 | [diff] [blame] | 1533 | if test "$sol2ver" -ge 11; then |
Darren Tucker | 93a2d41 | 2012-02-24 10:40:41 +1100 | [diff] [blame] | 1534 | SSHDLIBS="$SSHDLIBS -lscf" |
| 1535 | AC_DEFINE([BROKEN_BSM_API], [1], |
| 1536 | [The system has incomplete BSM API]) |
| 1537 | fi |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1538 | ;; |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1539 | linux) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1540 | AC_MSG_RESULT([linux]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1541 | AUDIT_MODULE=linux |
| 1542 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1543 | AC_CHECK_HEADERS([libaudit.h]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1544 | SSHDLIBS="$SSHDLIBS -laudit" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1545 | AC_DEFINE([USE_LINUX_AUDIT], [1], [Use Linux audit module]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1546 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1547 | debug) |
| 1548 | AUDIT_MODULE=debug |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1549 | AC_MSG_RESULT([debug]) |
| 1550 | AC_DEFINE([SSH_AUDIT_EVENTS], [1], [Use audit debugging module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1551 | ;; |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1552 | no) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1553 | AC_MSG_RESULT([no]) |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1554 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1555 | *) |
| 1556 | AC_MSG_ERROR([Unknown audit module $withval]) |
| 1557 | ;; |
| 1558 | esac ] |
| 1559 | ) |
| 1560 | |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1561 | AC_ARG_WITH([pie], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 1562 | [ --with-pie Build Position Independent Executables if possible], [ |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1563 | if test "x$withval" = "xno"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1564 | use_pie=no |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1565 | fi |
| 1566 | if test "x$withval" = "xyes"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1567 | use_pie=yes |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1568 | fi |
| 1569 | ] |
| 1570 | ) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1571 | if test "x$use_pie" = "x"; then |
| 1572 | use_pie=no |
| 1573 | fi |
| 1574 | if test "x$use_toolchain_hardening" != "x1" && test "x$use_pie" = "xauto"; then |
| 1575 | # Turn off automatic PIE when toolchain hardening is off. |
| 1576 | use_pie=no |
| 1577 | fi |
Damien Miller | c161fc9 | 2014-01-29 21:01:33 +1100 | [diff] [blame] | 1578 | if test "x$use_pie" = "xauto"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1579 | # Automatic PIE requires gcc >= 4.x |
| 1580 | AC_MSG_CHECKING([for gcc >= 4.x]) |
| 1581 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
| 1582 | #if !defined(__GNUC__) || __GNUC__ < 4 |
| 1583 | #error gcc is too old |
| 1584 | #endif |
| 1585 | ]])], |
| 1586 | [ AC_MSG_RESULT([yes]) ], |
| 1587 | [ AC_MSG_RESULT([no]) |
| 1588 | use_pie=no ] |
| 1589 | ) |
| 1590 | fi |
| 1591 | if test "x$use_pie" != "xno"; then |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1592 | SAVED_CFLAGS="$CFLAGS" |
| 1593 | SAVED_LDFLAGS="$LDFLAGS" |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1594 | OSSH_CHECK_CFLAG_COMPILE([-fPIE]) |
| 1595 | OSSH_CHECK_LDFLAG_LINK([-pie]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1596 | # We use both -fPIE and -pie or neither. |
| 1597 | AC_MSG_CHECKING([whether both -fPIE and -pie are supported]) |
| 1598 | if echo "x $CFLAGS" | grep ' -fPIE' >/dev/null 2>&1 && \ |
| 1599 | echo "x $LDFLAGS" | grep ' -pie' >/dev/null 2>&1 ; then |
| 1600 | AC_MSG_RESULT([yes]) |
| 1601 | else |
| 1602 | AC_MSG_RESULT([no]) |
| 1603 | CFLAGS="$SAVED_CFLAGS" |
| 1604 | LDFLAGS="$SAVED_LDFLAGS" |
| 1605 | fi |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1606 | fi |
| 1607 | |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1608 | dnl Checks for library functions. Please keep in alphabetical order |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1609 | AC_CHECK_FUNCS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1610 | Blowfish_initstate \ |
| 1611 | Blowfish_expandstate \ |
| 1612 | Blowfish_expand0state \ |
| 1613 | Blowfish_stream2word \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1614 | asprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1615 | b64_ntop \ |
| 1616 | __b64_ntop \ |
| 1617 | b64_pton \ |
| 1618 | __b64_pton \ |
| 1619 | bcopy \ |
Damien Miller | a913442 | 2013-12-07 11:35:36 +1100 | [diff] [blame] | 1620 | bcrypt_pbkdf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1621 | bindresvport_sa \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1622 | blf_enc \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 1623 | cap_rights_limit \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1624 | clock \ |
| 1625 | closefrom \ |
| 1626 | dirfd \ |
Darren Tucker | efdf534 | 2013-05-30 08:29:08 +1000 | [diff] [blame] | 1627 | endgrent \ |
Damien Miller | 1d2c456 | 2014-02-04 11:18:20 +1100 | [diff] [blame] | 1628 | explicit_bzero \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1629 | fchmod \ |
| 1630 | fchown \ |
| 1631 | freeaddrinfo \ |
Darren Tucker | a5cf1e2 | 2014-01-17 18:10:58 +1100 | [diff] [blame] | 1632 | fstatfs \ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 1633 | fstatvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1634 | futimes \ |
| 1635 | getaddrinfo \ |
| 1636 | getcwd \ |
| 1637 | getgrouplist \ |
| 1638 | getnameinfo \ |
| 1639 | getopt \ |
| 1640 | getpeereid \ |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1641 | getpeerucred \ |
Darren Tucker | 3c4a24c | 2013-02-15 11:41:35 +1100 | [diff] [blame] | 1642 | getpgid \ |
| 1643 | getpgrp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1644 | _getpty \ |
| 1645 | getrlimit \ |
| 1646 | getttyent \ |
| 1647 | glob \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1648 | group_from_gid \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1649 | inet_aton \ |
| 1650 | inet_ntoa \ |
| 1651 | inet_ntop \ |
| 1652 | innetgr \ |
| 1653 | login_getcapbool \ |
Darren Tucker | ae133d4 | 2013-06-06 08:30:20 +1000 | [diff] [blame] | 1654 | mblen \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1655 | md5_crypt \ |
| 1656 | memmove \ |
Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 1657 | memset_s \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1658 | mkdtemp \ |
| 1659 | mmap \ |
| 1660 | ngetaddrinfo \ |
| 1661 | nsleep \ |
| 1662 | ogetaddrinfo \ |
| 1663 | openlog_r \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 1664 | poll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1665 | prctl \ |
| 1666 | pstat \ |
| 1667 | readpassphrase \ |
Darren Tucker | 642652d | 2014-12-10 01:32:23 +1100 | [diff] [blame] | 1668 | reallocarray \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1669 | realpath \ |
| 1670 | recvmsg \ |
| 1671 | rresvport_af \ |
| 1672 | sendmsg \ |
| 1673 | setdtablesize \ |
| 1674 | setegid \ |
| 1675 | setenv \ |
| 1676 | seteuid \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1677 | setgroupent \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1678 | setgroups \ |
Darren Tucker | 34f702a | 2012-07-04 08:50:09 +1000 | [diff] [blame] | 1679 | setlinebuf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1680 | setlogin \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1681 | setpassent\ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1682 | setpcred \ |
| 1683 | setproctitle \ |
| 1684 | setregid \ |
| 1685 | setreuid \ |
| 1686 | setrlimit \ |
| 1687 | setsid \ |
| 1688 | setvbuf \ |
| 1689 | sigaction \ |
| 1690 | sigvec \ |
| 1691 | snprintf \ |
| 1692 | socketpair \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 1693 | statfs \ |
| 1694 | statvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1695 | strdup \ |
| 1696 | strerror \ |
| 1697 | strlcat \ |
| 1698 | strlcpy \ |
| 1699 | strmode \ |
Darren Tucker | b54f50e | 2011-09-29 23:17:18 +1000 | [diff] [blame] | 1700 | strnlen \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1701 | strnvis \ |
Darren Tucker | aa74f67 | 2010-08-16 13:15:23 +1000 | [diff] [blame] | 1702 | strptime \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1703 | strtonum \ |
Darren Tucker | 81eb5d5 | 2005-06-01 21:39:33 +1000 | [diff] [blame] | 1704 | strtoll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1705 | strtoul \ |
Darren Tucker | 8e6fb78 | 2013-02-15 12:13:01 +1100 | [diff] [blame] | 1706 | strtoull \ |
Damien Miller | 34a1769 | 2007-06-11 14:15:42 +1000 | [diff] [blame] | 1707 | swap32 \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1708 | sysconf \ |
| 1709 | tcgetpgrp \ |
Damien Miller | aa18063 | 2010-10-07 21:25:27 +1100 | [diff] [blame] | 1710 | timingsafe_bcmp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1711 | truncate \ |
| 1712 | unsetenv \ |
| 1713 | updwtmpx \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1714 | user_from_uid \ |
Damien Miller | f4db77d | 2013-03-15 10:34:25 +1100 | [diff] [blame] | 1715 | usleep \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1716 | vasprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1717 | vsnprintf \ |
| 1718 | waitpid \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1719 | ]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1720 | |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1721 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1722 | [AC_LANG_PROGRAM( |
| 1723 | [[ #include <ctype.h> ]], |
| 1724 | [[ return (isblank('a')); ]])], |
| 1725 | [AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).]) |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1726 | ]) |
| 1727 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1728 | # PKCS11 depends on OpenSSL. |
| 1729 | if test "x$openssl" = "xyes" ; then |
| 1730 | # PKCS#11 support requires dlopen() and co |
| 1731 | AC_SEARCH_LIBS([dlopen], [dl], |
| 1732 | [AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])] |
| 1733 | ) |
| 1734 | fi |
Damien Miller | b3c9f78 | 2010-02-12 10:11:34 +1100 | [diff] [blame] | 1735 | |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1736 | # IRIX has a const char return value for gai_strerror() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1737 | AC_CHECK_FUNCS([gai_strerror], [ |
| 1738 | AC_DEFINE([HAVE_GAI_STRERROR]) |
| 1739 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1740 | #include <sys/types.h> |
| 1741 | #include <sys/socket.h> |
| 1742 | #include <netdb.h> |
| 1743 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1744 | const char *gai_strerror(int); |
| 1745 | ]], [[ |
| 1746 | char *str; |
| 1747 | str = gai_strerror(0); |
| 1748 | ]])], [ |
| 1749 | AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1], |
| 1750 | [Define if gai_strerror() returns const char *])], [])]) |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1751 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1752 | AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], |
| 1753 | [Some systems put nanosleep outside of libc])]) |
Damien Miller | cd6853c | 2003-01-28 11:33:42 +1100 | [diff] [blame] | 1754 | |
Darren Tucker | a710891 | 2013-06-02 08:18:31 +1000 | [diff] [blame] | 1755 | AC_SEARCH_LIBS([clock_gettime], [rt], |
| 1756 | [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) |
| 1757 | |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1758 | dnl Make sure prototypes are defined for these before using them. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1759 | AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])]) |
| 1760 | AC_CHECK_DECL([strsep], |
| 1761 | [AC_CHECK_FUNCS([strsep])], |
Darren Tucker | 390b6d5 | 2005-05-28 16:54:36 +1000 | [diff] [blame] | 1762 | [], |
| 1763 | [ |
| 1764 | #ifdef HAVE_STRING_H |
| 1765 | # include <string.h> |
| 1766 | #endif |
| 1767 | ]) |
Ben Lindstrom | 3e00647 | 2002-10-16 00:24:03 +0000 | [diff] [blame] | 1768 | |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1769 | dnl tcsendbreak might be a macro |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1770 | AC_CHECK_DECL([tcsendbreak], |
| 1771 | [AC_DEFINE([HAVE_TCSENDBREAK])], |
| 1772 | [AC_CHECK_FUNCS([tcsendbreak])], |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1773 | [#include <termios.h>] |
| 1774 | ) |
| 1775 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1776 | AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>]) |
Darren Tucker | 5bb1400 | 2004-04-23 18:53:10 +1000 | [diff] [blame] | 1777 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1778 | AC_CHECK_DECLS([SHUT_RD], , , |
Darren Tucker | 128a089 | 2006-07-12 19:02:56 +1000 | [diff] [blame] | 1779 | [ |
| 1780 | #include <sys/types.h> |
| 1781 | #include <sys/socket.h> |
| 1782 | ]) |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1783 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1784 | AC_CHECK_DECLS([O_NONBLOCK], , , |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1785 | [ |
| 1786 | #include <sys/types.h> |
| 1787 | #ifdef HAVE_SYS_STAT_H |
| 1788 | # include <sys/stat.h> |
| 1789 | #endif |
| 1790 | #ifdef HAVE_FCNTL_H |
| 1791 | # include <fcntl.h> |
| 1792 | #endif |
| 1793 | ]) |
| 1794 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1795 | AC_CHECK_DECLS([writev], , , [ |
Darren Tucker | ed0b592 | 2006-09-03 22:44:49 +1000 | [diff] [blame] | 1796 | #include <sys/types.h> |
| 1797 | #include <sys/uio.h> |
| 1798 | #include <unistd.h> |
| 1799 | ]) |
| 1800 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1801 | AC_CHECK_DECLS([MAXSYMLINKS], , , [ |
Darren Tucker | 6d862a5 | 2007-04-29 14:39:02 +1000 | [diff] [blame] | 1802 | #include <sys/param.h> |
| 1803 | ]) |
| 1804 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1805 | AC_CHECK_DECLS([offsetof], , , [ |
Darren Tucker | dca0edf | 2007-04-29 15:06:44 +1000 | [diff] [blame] | 1806 | #include <stddef.h> |
| 1807 | ]) |
| 1808 | |
Darren Tucker | c7aad00 | 2013-06-02 07:18:47 +1000 | [diff] [blame] | 1809 | # extra bits for select(2) |
| 1810 | AC_CHECK_DECLS([howmany, NFDBITS], [], [], [[ |
| 1811 | #include <sys/param.h> |
| 1812 | #include <sys/types.h> |
| 1813 | #ifdef HAVE_SYS_SYSMACROS_H |
| 1814 | #include <sys/sysmacros.h> |
| 1815 | #endif |
| 1816 | #ifdef HAVE_SYS_SELECT_H |
| 1817 | #include <sys/select.h> |
| 1818 | #endif |
| 1819 | #ifdef HAVE_SYS_TIME_H |
| 1820 | #include <sys/time.h> |
| 1821 | #endif |
| 1822 | #ifdef HAVE_UNISTD_H |
| 1823 | #include <unistd.h> |
| 1824 | #endif |
| 1825 | ]]) |
| 1826 | AC_CHECK_TYPES([fd_mask], [], [], [[ |
| 1827 | #include <sys/param.h> |
| 1828 | #include <sys/types.h> |
| 1829 | #ifdef HAVE_SYS_SELECT_H |
| 1830 | #include <sys/select.h> |
| 1831 | #endif |
| 1832 | #ifdef HAVE_SYS_TIME_H |
| 1833 | #include <sys/time.h> |
| 1834 | #endif |
| 1835 | #ifdef HAVE_UNISTD_H |
| 1836 | #include <unistd.h> |
| 1837 | #endif |
| 1838 | ]]) |
| 1839 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1840 | AC_CHECK_FUNCS([setresuid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1841 | dnl Some platorms have setresuid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1842 | AC_MSG_CHECKING([if setresuid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1843 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1844 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1845 | #include <stdlib.h> |
| 1846 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1847 | ]], [[ |
| 1848 | errno=0; |
| 1849 | setresuid(0,0,0); |
| 1850 | if (errno==ENOSYS) |
| 1851 | exit(1); |
| 1852 | else |
| 1853 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1854 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1855 | [AC_MSG_RESULT([yes])], |
| 1856 | [AC_DEFINE([BROKEN_SETRESUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1857 | [Define if your setresuid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1858 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1859 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1860 | ) |
| 1861 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1862 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1863 | AC_CHECK_FUNCS([setresgid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1864 | dnl Some platorms have setresgid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1865 | AC_MSG_CHECKING([if setresgid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1866 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1867 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1868 | #include <stdlib.h> |
| 1869 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1870 | ]], [[ |
| 1871 | errno=0; |
| 1872 | setresgid(0,0,0); |
| 1873 | if (errno==ENOSYS) |
| 1874 | exit(1); |
| 1875 | else |
| 1876 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1877 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1878 | [AC_MSG_RESULT([yes])], |
| 1879 | [AC_DEFINE([BROKEN_SETRESGID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1880 | [Define if your setresgid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1881 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1882 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1883 | ) |
| 1884 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1885 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1886 | dnl Checks for time functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1887 | AC_CHECK_FUNCS([gettimeofday time]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1888 | dnl Checks for utmp functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1889 | AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent]) |
| 1890 | AC_CHECK_FUNCS([utmpname]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1891 | dnl Checks for utmpx functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1892 | AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline getutxuser pututxline]) |
| 1893 | AC_CHECK_FUNCS([setutxdb setutxent utmpxname]) |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 1894 | dnl Checks for lastlog functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1895 | AC_CHECK_FUNCS([getlastlogxbyname]) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 1896 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1897 | AC_CHECK_FUNC([daemon], |
| 1898 | [AC_DEFINE([HAVE_DAEMON], [1], [Define if your libraries define daemon()])], |
| 1899 | [AC_CHECK_LIB([bsd], [daemon], |
| 1900 | [LIBS="$LIBS -lbsd"; AC_DEFINE([HAVE_DAEMON])])] |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 1901 | ) |
| 1902 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1903 | AC_CHECK_FUNC([getpagesize], |
| 1904 | [AC_DEFINE([HAVE_GETPAGESIZE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1905 | [Define if your libraries define getpagesize()])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1906 | [AC_CHECK_LIB([ucb], [getpagesize], |
| 1907 | [LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])] |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 1908 | ) |
| 1909 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1910 | # Check for broken snprintf |
| 1911 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 1912 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1913 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1914 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 1915 | [[ |
| 1916 | char b[5]; |
| 1917 | snprintf(b,5,"123456789"); |
| 1918 | exit(b[4]!='\0'); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1919 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1920 | [AC_MSG_RESULT([yes])], |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1921 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1922 | AC_MSG_RESULT([no]) |
| 1923 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1924 | [Define if your snprintf is busted]) |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1925 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1926 | ], |
| 1927 | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1928 | ) |
| 1929 | fi |
| 1930 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 1931 | # We depend on vsnprintf returning the right thing on overflow: the |
| 1932 | # number of characters it tried to create (as per SUSv3) |
| 1933 | if test "x$ac_cv_func_vsnprintf" = "xyes" ; then |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1934 | AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) |
| 1935 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1936 | [AC_LANG_PROGRAM([[ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1937 | #include <sys/types.h> |
| 1938 | #include <stdio.h> |
| 1939 | #include <stdarg.h> |
| 1940 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 1941 | int x_snprintf(char *str, size_t count, const char *fmt, ...) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1942 | { |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 1943 | size_t ret; |
| 1944 | va_list ap; |
| 1945 | |
| 1946 | va_start(ap, fmt); |
| 1947 | ret = vsnprintf(str, count, fmt, ap); |
| 1948 | va_end(ap); |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1949 | return ret; |
| 1950 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1951 | ]], [[ |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 1952 | char x[1]; |
| 1953 | if (x_snprintf(x, 1, "%s %d", "hello", 12345) != 11) |
| 1954 | return 1; |
| 1955 | if (x_snprintf(NULL, 0, "%s %d", "hello", 12345) != 11) |
| 1956 | return 1; |
| 1957 | return 0; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1958 | ]])], |
| 1959 | [AC_MSG_RESULT([yes])], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1960 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1961 | AC_MSG_RESULT([no]) |
| 1962 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1963 | [Define if your snprintf is busted]) |
| 1964 | AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor]) |
| 1965 | ], |
| 1966 | [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ] |
| 1967 | ) |
| 1968 | fi |
| 1969 | |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 1970 | # On systems where [v]snprintf is broken, but is declared in stdio, |
| 1971 | # check that the fmt argument is const char * or just char *. |
| 1972 | # This is only useful for when BROKEN_SNPRINTF |
| 1973 | AC_MSG_CHECKING([whether snprintf can declare const char *fmt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1974 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1975 | #include <stdio.h> |
| 1976 | int snprintf(char *a, size_t b, const char *c, ...) { return 0; } |
| 1977 | ]], [[ |
| 1978 | snprintf(0, 0, 0); |
| 1979 | ]])], |
| 1980 | [AC_MSG_RESULT([yes]) |
| 1981 | AC_DEFINE([SNPRINTF_CONST], [const], |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 1982 | [Define as const if snprintf() can declare const char *fmt])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1983 | [AC_MSG_RESULT([no]) |
| 1984 | AC_DEFINE([SNPRINTF_CONST], [/* not const */])]) |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 1985 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 1986 | # Check for missing getpeereid (or equiv) support |
| 1987 | NO_PEERCHECK="" |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1988 | 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] | 1989 | AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1990 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1991 | #include <sys/types.h> |
| 1992 | #include <sys/socket.h>]], [[int i = SO_PEERCRED;]])], |
| 1993 | [ AC_MSG_RESULT([yes]) |
| 1994 | AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have PEERCRED socket option]) |
| 1995 | ], [AC_MSG_RESULT([no]) |
| 1996 | NO_PEERCHECK=1 |
| 1997 | ]) |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 1998 | fi |
| 1999 | |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2000 | dnl see whether mkstemp() requires XXXXXX |
| 2001 | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then |
| 2002 | AC_MSG_CHECKING([for (overly) strict mkstemp]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2003 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2004 | [AC_LANG_PROGRAM([[ |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2005 | #include <stdlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2006 | ]], [[ |
| 2007 | char template[]="conftest.mkstemp-test"; |
| 2008 | if (mkstemp(template) == -1) |
| 2009 | exit(1); |
| 2010 | unlink(template); |
| 2011 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2012 | ]])], |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2013 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2014 | AC_MSG_RESULT([no]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2015 | ], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2016 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2017 | AC_MSG_RESULT([yes]) |
| 2018 | AC_DEFINE([HAVE_STRICT_MKSTEMP], [1], [Silly mkstemp()]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2019 | ], |
| 2020 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2021 | AC_MSG_RESULT([yes]) |
| 2022 | AC_DEFINE([HAVE_STRICT_MKSTEMP]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2023 | ] |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2024 | ) |
| 2025 | fi |
| 2026 | |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2027 | dnl make sure that openpty does not reacquire controlling terminal |
| 2028 | if test ! -z "$check_for_openpty_ctty_bug"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2029 | AC_MSG_CHECKING([if openpty correctly handles controlling tty]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2030 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2031 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2032 | #include <stdio.h> |
| 2033 | #include <sys/fcntl.h> |
| 2034 | #include <sys/types.h> |
| 2035 | #include <sys/wait.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2036 | ]], [[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2037 | pid_t pid; |
| 2038 | int fd, ptyfd, ttyfd, status; |
| 2039 | |
| 2040 | pid = fork(); |
| 2041 | if (pid < 0) { /* failed */ |
| 2042 | exit(1); |
| 2043 | } else if (pid > 0) { /* parent */ |
| 2044 | waitpid(pid, &status, 0); |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2045 | if (WIFEXITED(status)) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2046 | exit(WEXITSTATUS(status)); |
| 2047 | else |
| 2048 | exit(2); |
| 2049 | } else { /* child */ |
| 2050 | close(0); close(1); close(2); |
| 2051 | setsid(); |
| 2052 | openpty(&ptyfd, &ttyfd, NULL, NULL, NULL); |
| 2053 | fd = open("/dev/tty", O_RDWR | O_NOCTTY); |
| 2054 | if (fd >= 0) |
| 2055 | exit(3); /* Acquired ctty: broken */ |
| 2056 | else |
| 2057 | exit(0); /* Did not acquire ctty: OK */ |
| 2058 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2059 | ]])], |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2060 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2061 | AC_MSG_RESULT([yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2062 | ], |
| 2063 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2064 | AC_MSG_RESULT([no]) |
| 2065 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2066 | ], |
| 2067 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2068 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2069 | ] |
| 2070 | ) |
| 2071 | fi |
| 2072 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2073 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2074 | test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2075 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2076 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2077 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2078 | #include <stdio.h> |
| 2079 | #include <sys/socket.h> |
| 2080 | #include <netdb.h> |
| 2081 | #include <errno.h> |
| 2082 | #include <netinet/in.h> |
| 2083 | |
| 2084 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2085 | ]], [[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2086 | int err, sock; |
| 2087 | struct addrinfo *gai_ai, *ai, hints; |
| 2088 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2089 | |
| 2090 | memset(&hints, 0, sizeof(hints)); |
| 2091 | hints.ai_family = PF_UNSPEC; |
| 2092 | hints.ai_socktype = SOCK_STREAM; |
| 2093 | hints.ai_flags = AI_PASSIVE; |
| 2094 | |
| 2095 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2096 | if (err != 0) { |
| 2097 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2098 | exit(1); |
| 2099 | } |
| 2100 | |
| 2101 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2102 | if (ai->ai_family != AF_INET6) |
| 2103 | continue; |
| 2104 | |
| 2105 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2106 | sizeof(ntop), strport, sizeof(strport), |
| 2107 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2108 | |
| 2109 | if (err != 0) { |
| 2110 | if (err == EAI_SYSTEM) |
| 2111 | perror("getnameinfo EAI_SYSTEM"); |
| 2112 | else |
| 2113 | fprintf(stderr, "getnameinfo failed: %s\n", |
| 2114 | gai_strerror(err)); |
| 2115 | exit(2); |
| 2116 | } |
| 2117 | |
| 2118 | sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
| 2119 | if (sock < 0) |
| 2120 | perror("socket"); |
| 2121 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
| 2122 | if (errno == EBADF) |
| 2123 | exit(3); |
| 2124 | } |
| 2125 | } |
| 2126 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2127 | ]])], |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2128 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2129 | AC_MSG_RESULT([yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2130 | ], |
| 2131 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2132 | AC_MSG_RESULT([no]) |
| 2133 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2134 | ], |
| 2135 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2136 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2137 | ] |
| 2138 | ) |
| 2139 | fi |
| 2140 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2141 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2142 | test "x$check_for_aix_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2143 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2144 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2145 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2146 | #include <stdio.h> |
| 2147 | #include <sys/socket.h> |
| 2148 | #include <netdb.h> |
| 2149 | #include <errno.h> |
| 2150 | #include <netinet/in.h> |
| 2151 | |
| 2152 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2153 | ]], [[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2154 | int err, sock; |
| 2155 | struct addrinfo *gai_ai, *ai, hints; |
| 2156 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2157 | |
| 2158 | memset(&hints, 0, sizeof(hints)); |
| 2159 | hints.ai_family = PF_UNSPEC; |
| 2160 | hints.ai_socktype = SOCK_STREAM; |
| 2161 | hints.ai_flags = AI_PASSIVE; |
| 2162 | |
| 2163 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2164 | if (err != 0) { |
| 2165 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2166 | exit(1); |
| 2167 | } |
| 2168 | |
| 2169 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2170 | if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) |
| 2171 | continue; |
| 2172 | |
| 2173 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2174 | sizeof(ntop), strport, sizeof(strport), |
| 2175 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2176 | |
| 2177 | if (ai->ai_family == AF_INET && err != 0) { |
| 2178 | perror("getnameinfo"); |
| 2179 | exit(2); |
| 2180 | } |
| 2181 | } |
| 2182 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2183 | ]])], |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2184 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2185 | AC_MSG_RESULT([yes]) |
| 2186 | AC_DEFINE([AIX_GETNAMEINFO_HACK], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2187 | [Define if you have a getaddrinfo that fails |
| 2188 | for the all-zeros IPv6 address]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2189 | ], |
| 2190 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2191 | AC_MSG_RESULT([no]) |
| 2192 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2193 | ], |
Darren Tucker | 8b272ab | 2006-06-27 11:20:28 +1000 | [diff] [blame] | 2194 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2195 | AC_MSG_RESULT([cross-compiling, assuming no]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2196 | ] |
| 2197 | ) |
| 2198 | fi |
| 2199 | |
Darren Tucker | e50e8c9 | 2015-02-21 15:10:33 +1100 | [diff] [blame^] | 2200 | if test "x$ac_cv_func_getaddrinfo" = "xyes"; then |
| 2201 | AC_CHECK_DECLS(AI_NUMERICSERV, , , |
| 2202 | [#include <sys/types.h> |
| 2203 | #include <sys/socket.h> |
| 2204 | #include <netdb.h>]) |
| 2205 | fi |
| 2206 | |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2207 | if test "x$check_for_conflicting_getspnam" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2208 | AC_MSG_CHECKING([for conflicting getspnam in shadow.h]) |
| 2209 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]], |
| 2210 | [[ exit(0); ]])], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2211 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2212 | AC_MSG_RESULT([no]) |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2213 | ], |
| 2214 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2215 | AC_MSG_RESULT([yes]) |
| 2216 | AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2217 | [Conflicting defs for getspnam]) |
| 2218 | ] |
| 2219 | ) |
| 2220 | fi |
| 2221 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 2222 | AC_FUNC_GETPGRP |
| 2223 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2224 | # Search for OpenSSL |
| 2225 | saved_CPPFLAGS="$CPPFLAGS" |
| 2226 | saved_LDFLAGS="$LDFLAGS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2227 | AC_ARG_WITH([ssl-dir], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2228 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 2229 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2230 | if test "x$openssl" = "xno" ; then |
| 2231 | AC_MSG_ERROR([cannot use --with-ssl-dir when OpenSSL disabled]) |
| 2232 | fi |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 2233 | if test "x$withval" != "xno" ; then |
Darren Tucker | c7e38d5 | 2005-02-09 22:12:30 +1100 | [diff] [blame] | 2234 | case "$withval" in |
| 2235 | # Relative paths |
| 2236 | ./*|../*) withval="`pwd`/$withval" |
| 2237 | esac |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2238 | if test -d "$withval/lib"; then |
| 2239 | if test -n "${need_dash_r}"; then |
| 2240 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 2241 | else |
| 2242 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 2243 | fi |
Darren Tucker | 9f8703b | 2010-04-23 11:12:06 +1000 | [diff] [blame] | 2244 | elif test -d "$withval/lib64"; then |
| 2245 | if test -n "${need_dash_r}"; then |
| 2246 | LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}" |
| 2247 | else |
| 2248 | LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" |
| 2249 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2250 | else |
| 2251 | if test -n "${need_dash_r}"; then |
| 2252 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
| 2253 | else |
| 2254 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 2255 | fi |
| 2256 | fi |
| 2257 | if test -d "$withval/include"; then |
| 2258 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 2259 | else |
| 2260 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 2261 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2262 | fi |
| 2263 | ] |
| 2264 | ) |
Damien Miller | b9c5667 | 2014-05-15 14:43:37 +1000 | [diff] [blame] | 2265 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2266 | AC_ARG_WITH([openssl-header-check], |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2267 | [ --without-openssl-header-check Disable OpenSSL version consistency check], |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2268 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2269 | if test "x$withval" = "xno" ; then |
| 2270 | openssl_check_nonfatal=1 |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2271 | fi |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2272 | ] |
| 2273 | ) |
| 2274 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2275 | openssl_engine=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2276 | AC_ARG_WITH([ssl-engine], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2277 | [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2278 | [ |
| 2279 | if test "x$openssl" = "xno" ; then |
| 2280 | AC_MSG_ERROR([cannot use --with-ssl-engine when OpenSSL disabled]) |
| 2281 | fi |
| 2282 | if test "x$withval" != "xno" ; then |
| 2283 | openssl_engine=yes |
| 2284 | fi |
| 2285 | ] |
| 2286 | ) |
| 2287 | |
| 2288 | if test "x$openssl" = "xyes" ; then |
| 2289 | LIBS="-lcrypto $LIBS" |
| 2290 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL], [1], |
| 2291 | [Define if your ssl headers are included |
| 2292 | with #include <openssl/header.h>])], |
| 2293 | [ |
| 2294 | dnl Check default openssl install dir |
| 2295 | if test -n "${need_dash_r}"; then |
| 2296 | LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}" |
| 2297 | else |
| 2298 | LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" |
| 2299 | fi |
| 2300 | CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" |
| 2301 | AC_CHECK_HEADER([openssl/opensslv.h], , |
| 2302 | [AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])]) |
| 2303 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL])], |
| 2304 | [ |
| 2305 | AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) |
| 2306 | ] |
| 2307 | ) |
| 2308 | ] |
| 2309 | ) |
| 2310 | |
| 2311 | # Determine OpenSSL header version |
| 2312 | AC_MSG_CHECKING([OpenSSL header version]) |
| 2313 | AC_RUN_IFELSE( |
| 2314 | [AC_LANG_PROGRAM([[ |
| 2315 | #include <stdio.h> |
| 2316 | #include <string.h> |
| 2317 | #include <openssl/opensslv.h> |
| 2318 | #define DATA "conftest.sslincver" |
| 2319 | ]], [[ |
| 2320 | FILE *fd; |
| 2321 | int rc; |
| 2322 | |
| 2323 | fd = fopen(DATA,"w"); |
| 2324 | if(fd == NULL) |
| 2325 | exit(1); |
| 2326 | |
| 2327 | if ((rc = fprintf(fd ,"%08x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0) |
| 2328 | exit(1); |
| 2329 | |
| 2330 | exit(0); |
| 2331 | ]])], |
| 2332 | [ |
| 2333 | ssl_header_ver=`cat conftest.sslincver` |
| 2334 | AC_MSG_RESULT([$ssl_header_ver]) |
| 2335 | ], |
| 2336 | [ |
| 2337 | AC_MSG_RESULT([not found]) |
| 2338 | AC_MSG_ERROR([OpenSSL version header not found.]) |
| 2339 | ], |
| 2340 | [ |
| 2341 | AC_MSG_WARN([cross compiling: not checking]) |
| 2342 | ] |
| 2343 | ) |
| 2344 | |
| 2345 | # Determine OpenSSL library version |
| 2346 | AC_MSG_CHECKING([OpenSSL library version]) |
| 2347 | AC_RUN_IFELSE( |
| 2348 | [AC_LANG_PROGRAM([[ |
| 2349 | #include <stdio.h> |
| 2350 | #include <string.h> |
| 2351 | #include <openssl/opensslv.h> |
| 2352 | #include <openssl/crypto.h> |
| 2353 | #define DATA "conftest.ssllibver" |
| 2354 | ]], [[ |
| 2355 | FILE *fd; |
| 2356 | int rc; |
| 2357 | |
| 2358 | fd = fopen(DATA,"w"); |
| 2359 | if(fd == NULL) |
| 2360 | exit(1); |
| 2361 | |
| 2362 | if ((rc = fprintf(fd ,"%08x (%s)\n", SSLeay(), |
| 2363 | SSLeay_version(SSLEAY_VERSION))) <0) |
| 2364 | exit(1); |
| 2365 | |
| 2366 | exit(0); |
| 2367 | ]])], |
| 2368 | [ |
| 2369 | ssl_library_ver=`cat conftest.ssllibver` |
| 2370 | # Check version is supported. |
| 2371 | case "$ssl_library_ver" in |
| 2372 | 0090[[0-7]]*|009080[[0-5]]*) |
| 2373 | AC_MSG_ERROR([OpenSSL >= 0.9.8f required (have "$ssl_library_ver")]) |
| 2374 | ;; |
| 2375 | *) ;; |
| 2376 | esac |
| 2377 | AC_MSG_RESULT([$ssl_library_ver]) |
| 2378 | ], |
| 2379 | [ |
| 2380 | AC_MSG_RESULT([not found]) |
| 2381 | AC_MSG_ERROR([OpenSSL library not found.]) |
| 2382 | ], |
| 2383 | [ |
| 2384 | AC_MSG_WARN([cross compiling: not checking]) |
| 2385 | ] |
| 2386 | ) |
| 2387 | |
| 2388 | # Sanity check OpenSSL headers |
| 2389 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
| 2390 | AC_RUN_IFELSE( |
| 2391 | [AC_LANG_PROGRAM([[ |
| 2392 | #include <string.h> |
| 2393 | #include <openssl/opensslv.h> |
| 2394 | ]], [[ |
| 2395 | exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); |
| 2396 | ]])], |
| 2397 | [ |
| 2398 | AC_MSG_RESULT([yes]) |
| 2399 | ], |
| 2400 | [ |
| 2401 | AC_MSG_RESULT([no]) |
| 2402 | if test "x$openssl_check_nonfatal" = "x"; then |
| 2403 | AC_MSG_ERROR([Your OpenSSL headers do not match your |
| 2404 | library. Check config.log for details. |
| 2405 | If you are sure your installation is consistent, you can disable the check |
| 2406 | by running "./configure --without-openssl-header-check". |
| 2407 | Also see contrib/findssl.sh for help identifying header/library mismatches. |
| 2408 | ]) |
| 2409 | else |
| 2410 | AC_MSG_WARN([Your OpenSSL headers do not match your |
| 2411 | library. Check config.log for details. |
| 2412 | Also see contrib/findssl.sh for help identifying header/library mismatches.]) |
| 2413 | fi |
| 2414 | ], |
| 2415 | [ |
| 2416 | AC_MSG_WARN([cross compiling: not checking]) |
| 2417 | ] |
| 2418 | ) |
| 2419 | |
| 2420 | AC_MSG_CHECKING([if programs using OpenSSL functions will link]) |
| 2421 | AC_LINK_IFELSE( |
| 2422 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2423 | [[ SSLeay_add_all_algorithms(); ]])], |
| 2424 | [ |
| 2425 | AC_MSG_RESULT([yes]) |
| 2426 | ], |
| 2427 | [ |
| 2428 | AC_MSG_RESULT([no]) |
| 2429 | saved_LIBS="$LIBS" |
| 2430 | LIBS="$LIBS -ldl" |
| 2431 | AC_MSG_CHECKING([if programs using OpenSSL need -ldl]) |
| 2432 | AC_LINK_IFELSE( |
| 2433 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2434 | [[ SSLeay_add_all_algorithms(); ]])], |
| 2435 | [ |
| 2436 | AC_MSG_RESULT([yes]) |
| 2437 | ], |
| 2438 | [ |
| 2439 | AC_MSG_RESULT([no]) |
| 2440 | LIBS="$saved_LIBS" |
| 2441 | ] |
| 2442 | ) |
| 2443 | ] |
| 2444 | ) |
| 2445 | |
| 2446 | AC_CHECK_FUNCS([ \ |
| 2447 | BN_is_prime_ex \ |
| 2448 | DSA_generate_parameters_ex \ |
| 2449 | EVP_DigestInit_ex \ |
| 2450 | EVP_DigestFinal_ex \ |
| 2451 | EVP_MD_CTX_init \ |
| 2452 | EVP_MD_CTX_cleanup \ |
| 2453 | EVP_MD_CTX_copy_ex \ |
| 2454 | HMAC_CTX_init \ |
| 2455 | RSA_generate_key_ex \ |
| 2456 | RSA_get_default_method \ |
| 2457 | ]) |
| 2458 | |
| 2459 | if test "x$openssl_engine" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2460 | AC_MSG_CHECKING([for OpenSSL ENGINE support]) |
| 2461 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2462 | #include <openssl/engine.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2463 | ]], [[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2464 | ENGINE_load_builtin_engines(); |
| 2465 | ENGINE_register_all_complete(); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2466 | ]])], |
| 2467 | [ AC_MSG_RESULT([yes]) |
| 2468 | AC_DEFINE([USE_OPENSSL_ENGINE], [1], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2469 | [Enable OpenSSL engine support]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2470 | ], [ AC_MSG_ERROR([OpenSSL ENGINE support not found]) |
| 2471 | ]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2472 | fi |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2473 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2474 | # Check for OpenSSL without EVP_aes_{192,256}_cbc |
| 2475 | AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) |
| 2476 | AC_LINK_IFELSE( |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2477 | [AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2478 | #include <string.h> |
| 2479 | #include <openssl/evp.h> |
| 2480 | ]], [[ |
| 2481 | exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL); |
| 2482 | ]])], |
| 2483 | [ |
| 2484 | AC_MSG_RESULT([no]) |
| 2485 | ], |
| 2486 | [ |
| 2487 | AC_MSG_RESULT([yes]) |
| 2488 | AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1], |
| 2489 | [libcrypto is missing AES 192 and 256 bit functions]) |
| 2490 | ] |
| 2491 | ) |
| 2492 | |
| 2493 | # Check for OpenSSL with EVP_aes_*ctr |
| 2494 | AC_MSG_CHECKING([whether OpenSSL has AES CTR via EVP]) |
| 2495 | AC_LINK_IFELSE( |
| 2496 | [AC_LANG_PROGRAM([[ |
| 2497 | #include <string.h> |
| 2498 | #include <openssl/evp.h> |
| 2499 | ]], [[ |
| 2500 | exit(EVP_aes_128_ctr() == NULL || |
| 2501 | EVP_aes_192_cbc() == NULL || |
| 2502 | EVP_aes_256_cbc() == NULL); |
| 2503 | ]])], |
| 2504 | [ |
| 2505 | AC_MSG_RESULT([yes]) |
| 2506 | AC_DEFINE([OPENSSL_HAVE_EVPCTR], [1], |
| 2507 | [libcrypto has EVP AES CTR]) |
| 2508 | ], |
| 2509 | [ |
| 2510 | AC_MSG_RESULT([no]) |
| 2511 | ] |
| 2512 | ) |
| 2513 | |
| 2514 | # Check for OpenSSL with EVP_aes_*gcm |
| 2515 | AC_MSG_CHECKING([whether OpenSSL has AES GCM via EVP]) |
| 2516 | AC_LINK_IFELSE( |
| 2517 | [AC_LANG_PROGRAM([[ |
| 2518 | #include <string.h> |
| 2519 | #include <openssl/evp.h> |
| 2520 | ]], [[ |
| 2521 | exit(EVP_aes_128_gcm() == NULL || |
| 2522 | EVP_aes_256_gcm() == NULL || |
| 2523 | EVP_CTRL_GCM_SET_IV_FIXED == 0 || |
| 2524 | EVP_CTRL_GCM_IV_GEN == 0 || |
| 2525 | EVP_CTRL_GCM_SET_TAG == 0 || |
| 2526 | EVP_CTRL_GCM_GET_TAG == 0 || |
| 2527 | EVP_CIPHER_CTX_ctrl(NULL, 0, 0, NULL) == 0); |
| 2528 | ]])], |
| 2529 | [ |
| 2530 | AC_MSG_RESULT([yes]) |
| 2531 | AC_DEFINE([OPENSSL_HAVE_EVPGCM], [1], |
| 2532 | [libcrypto has EVP AES GCM]) |
| 2533 | ], |
| 2534 | [ |
| 2535 | AC_MSG_RESULT([no]) |
| 2536 | unsupported_algorithms="$unsupported_cipers \ |
| 2537 | aes128-gcm@openssh.com aes256-gcm@openssh.com" |
| 2538 | ] |
| 2539 | ) |
| 2540 | |
| 2541 | AC_SEARCH_LIBS([EVP_CIPHER_CTX_ctrl], [crypto], |
| 2542 | [AC_DEFINE([HAVE_EVP_CIPHER_CTX_CTRL], [1], |
| 2543 | [Define if libcrypto has EVP_CIPHER_CTX_ctrl])]) |
| 2544 | |
| 2545 | AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) |
| 2546 | AC_LINK_IFELSE( |
| 2547 | [AC_LANG_PROGRAM([[ |
| 2548 | #include <string.h> |
| 2549 | #include <openssl/evp.h> |
| 2550 | ]], [[ |
| 2551 | if(EVP_DigestUpdate(NULL, NULL,0)) |
| 2552 | exit(0); |
| 2553 | ]])], |
| 2554 | [ |
| 2555 | AC_MSG_RESULT([yes]) |
| 2556 | ], |
| 2557 | [ |
| 2558 | AC_MSG_RESULT([no]) |
| 2559 | AC_DEFINE([OPENSSL_EVP_DIGESTUPDATE_VOID], [1], |
| 2560 | [Define if EVP_DigestUpdate returns void]) |
| 2561 | ] |
| 2562 | ) |
| 2563 | |
| 2564 | # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, |
| 2565 | # because the system crypt() is more featureful. |
| 2566 | if test "x$check_for_libcrypt_before" = "x1"; then |
| 2567 | AC_CHECK_LIB([crypt], [crypt]) |
| 2568 | fi |
| 2569 | |
| 2570 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
| 2571 | # version in OpenSSL. |
| 2572 | if test "x$check_for_libcrypt_later" = "x1"; then |
| 2573 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
| 2574 | fi |
| 2575 | |
| 2576 | # Search for SHA256 support in libc and/or OpenSSL |
| 2577 | AC_CHECK_FUNCS([SHA256_Update EVP_sha256], , |
| 2578 | [unsupported_algorithms="$unsupported_algorithms \ |
| 2579 | hmac-sha2-256 hmac-sha2-512 \ |
| 2580 | diffie-hellman-group-exchange-sha256 \ |
| 2581 | hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com" |
| 2582 | ] |
| 2583 | ) |
| 2584 | # Search for RIPE-MD support in OpenSSL |
| 2585 | AC_CHECK_FUNCS([EVP_ripemd160], , |
| 2586 | [unsupported_algorithms="$unsupported_algorithms \ |
| 2587 | hmac-ripemd160 |
| 2588 | hmac-ripemd160@openssh.com |
| 2589 | hmac-ripemd160-etm@openssh.com" |
| 2590 | ] |
| 2591 | ) |
| 2592 | |
| 2593 | # Check complete ECC support in OpenSSL |
| 2594 | AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1]) |
| 2595 | AC_LINK_IFELSE( |
| 2596 | [AC_LANG_PROGRAM([[ |
| 2597 | #include <openssl/ec.h> |
| 2598 | #include <openssl/ecdh.h> |
| 2599 | #include <openssl/ecdsa.h> |
| 2600 | #include <openssl/evp.h> |
| 2601 | #include <openssl/objects.h> |
| 2602 | #include <openssl/opensslv.h> |
| 2603 | #if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */ |
| 2604 | # error "OpenSSL < 0.9.8g has unreliable ECC code" |
| 2605 | #endif |
| 2606 | ]], [[ |
| 2607 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); |
| 2608 | const EVP_MD *m = EVP_sha256(); /* We need this too */ |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2609 | ]])], |
| 2610 | [ AC_MSG_RESULT([yes]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2611 | enable_nistp256=1 ], |
| 2612 | [ AC_MSG_RESULT([no]) ] |
| 2613 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2614 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2615 | AC_MSG_CHECKING([whether OpenSSL has NID_secp384r1]) |
| 2616 | AC_LINK_IFELSE( |
| 2617 | [AC_LANG_PROGRAM([[ |
| 2618 | #include <openssl/ec.h> |
| 2619 | #include <openssl/ecdh.h> |
| 2620 | #include <openssl/ecdsa.h> |
| 2621 | #include <openssl/evp.h> |
| 2622 | #include <openssl/objects.h> |
| 2623 | #include <openssl/opensslv.h> |
| 2624 | #if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */ |
| 2625 | # error "OpenSSL < 0.9.8g has unreliable ECC code" |
| 2626 | #endif |
| 2627 | ]], [[ |
| 2628 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp384r1); |
| 2629 | const EVP_MD *m = EVP_sha384(); /* We need this too */ |
| 2630 | ]])], |
| 2631 | [ AC_MSG_RESULT([yes]) |
| 2632 | enable_nistp384=1 ], |
| 2633 | [ AC_MSG_RESULT([no]) ] |
| 2634 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2635 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2636 | AC_MSG_CHECKING([whether OpenSSL has NID_secp521r1]) |
| 2637 | AC_LINK_IFELSE( |
| 2638 | [AC_LANG_PROGRAM([[ |
| 2639 | #include <openssl/ec.h> |
| 2640 | #include <openssl/ecdh.h> |
| 2641 | #include <openssl/ecdsa.h> |
| 2642 | #include <openssl/evp.h> |
| 2643 | #include <openssl/objects.h> |
| 2644 | #include <openssl/opensslv.h> |
| 2645 | #if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */ |
| 2646 | # error "OpenSSL < 0.9.8g has unreliable ECC code" |
| 2647 | #endif |
| 2648 | ]], [[ |
| 2649 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2650 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2651 | ]])], |
| 2652 | [ AC_MSG_RESULT([yes]) |
| 2653 | AC_MSG_CHECKING([if OpenSSL's NID_secp521r1 is functional]) |
| 2654 | AC_RUN_IFELSE( |
| 2655 | [AC_LANG_PROGRAM([[ |
| 2656 | #include <openssl/ec.h> |
| 2657 | #include <openssl/ecdh.h> |
| 2658 | #include <openssl/ecdsa.h> |
| 2659 | #include <openssl/evp.h> |
| 2660 | #include <openssl/objects.h> |
| 2661 | #include <openssl/opensslv.h> |
| 2662 | ]],[[ |
| 2663 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2664 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2665 | exit(e == NULL || m == NULL); |
| 2666 | ]])], |
| 2667 | [ AC_MSG_RESULT([yes]) |
| 2668 | enable_nistp521=1 ], |
| 2669 | [ AC_MSG_RESULT([no]) ], |
| 2670 | [ AC_MSG_WARN([cross-compiling: assuming yes]) |
| 2671 | enable_nistp521=1 ] |
| 2672 | )], |
| 2673 | AC_MSG_RESULT([no]) |
| 2674 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2675 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2676 | COMMENT_OUT_ECC="#no ecc#" |
| 2677 | TEST_SSH_ECC=no |
| 2678 | |
| 2679 | if test x$enable_nistp256 = x1 || test x$enable_nistp384 = x1 || \ |
| 2680 | test x$enable_nistp521 = x1; then |
| 2681 | AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) |
| 2682 | fi |
| 2683 | if test x$enable_nistp256 = x1; then |
| 2684 | AC_DEFINE([OPENSSL_HAS_NISTP256], [1], |
| 2685 | [libcrypto has NID_X9_62_prime256v1]) |
| 2686 | TEST_SSH_ECC=yes |
| 2687 | COMMENT_OUT_ECC="" |
| 2688 | else |
| 2689 | unsupported_algorithms="$unsupported_algorithms ecdsa-sha2-nistp256 \ |
| 2690 | ecdh-sha2-nistp256 ecdsa-sha2-nistp256-cert-v01@openssh.com" |
| 2691 | fi |
| 2692 | if test x$enable_nistp384 = x1; then |
| 2693 | AC_DEFINE([OPENSSL_HAS_NISTP384], [1], [libcrypto has NID_secp384r1]) |
| 2694 | TEST_SSH_ECC=yes |
| 2695 | COMMENT_OUT_ECC="" |
| 2696 | else |
| 2697 | unsupported_algorithms="$unsupported_algorithms ecdsa-sha2-nistp384 \ |
| 2698 | ecdh-sha2-nistp384 ecdsa-sha2-nistp384-cert-v01@openssh.com" |
| 2699 | fi |
| 2700 | if test x$enable_nistp521 = x1; then |
| 2701 | AC_DEFINE([OPENSSL_HAS_NISTP521], [1], [libcrypto has NID_secp521r1]) |
| 2702 | TEST_SSH_ECC=yes |
| 2703 | COMMENT_OUT_ECC="" |
| 2704 | else |
| 2705 | unsupported_algorithms="$unsupported_algorithms ecdh-sha2-nistp521 \ |
| 2706 | ecdsa-sha2-nistp521 ecdsa-sha2-nistp521-cert-v01@openssh.com" |
| 2707 | fi |
| 2708 | |
| 2709 | AC_SUBST([TEST_SSH_ECC]) |
| 2710 | AC_SUBST([COMMENT_OUT_ECC]) |
| 2711 | else |
| 2712 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
| 2713 | AC_CHECK_FUNCS([crypt DES_crypt]) |
| 2714 | fi |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2715 | |
Damien Miller | 00f9cd2 | 2014-07-15 10:41:38 +1000 | [diff] [blame] | 2716 | AC_CHECK_FUNCS([ \ |
| 2717 | arc4random \ |
| 2718 | arc4random_buf \ |
| 2719 | arc4random_stir \ |
| 2720 | arc4random_uniform \ |
| 2721 | ]) |
| 2722 | |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2723 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2724 | AC_CHECK_LIB([iaf], [ia_openinfo], [ |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2725 | LIBS="$LIBS -liaf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2726 | AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf" |
| 2727 | AC_DEFINE([HAVE_LIBIAF], [1], |
Tim Rice | 0eeaf12 | 2007-09-10 16:24:17 -0700 | [diff] [blame] | 2728 | [Define if system has libiaf that supports set_id]) |
| 2729 | ]) |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2730 | ]) |
| 2731 | LIBS="$saved_LIBS" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2732 | |
| 2733 | ### Configure cryptographic random number support |
| 2734 | |
| 2735 | # Check wheter OpenSSL seeds itself |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2736 | if test "x$openssl" = "xyes" ; then |
| 2737 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
| 2738 | AC_RUN_IFELSE( |
| 2739 | [AC_LANG_PROGRAM([[ |
| 2740 | #include <string.h> |
| 2741 | #include <openssl/rand.h> |
| 2742 | ]], [[ |
| 2743 | exit(RAND_status() == 1 ? 0 : 1); |
| 2744 | ]])], |
| 2745 | [ |
| 2746 | OPENSSL_SEEDS_ITSELF=yes |
| 2747 | AC_MSG_RESULT([yes]) |
| 2748 | ], |
| 2749 | [ |
| 2750 | AC_MSG_RESULT([no]) |
| 2751 | ], |
| 2752 | [ |
| 2753 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 2754 | # This is safe, since we will fatal() at runtime if |
| 2755 | # OpenSSL is not seeded correctly. |
| 2756 | OPENSSL_SEEDS_ITSELF=yes |
| 2757 | ] |
| 2758 | ) |
| 2759 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2760 | |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 2761 | # PRNGD TCP socket |
| 2762 | AC_ARG_WITH([prngd-port], |
| 2763 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 2764 | [ |
| 2765 | case "$withval" in |
| 2766 | no) |
| 2767 | withval="" |
| 2768 | ;; |
| 2769 | [[0-9]]*) |
| 2770 | ;; |
| 2771 | *) |
| 2772 | AC_MSG_ERROR([You must specify a numeric port number for --with-prngd-port]) |
| 2773 | ;; |
| 2774 | esac |
| 2775 | if test ! -z "$withval" ; then |
| 2776 | PRNGD_PORT="$withval" |
| 2777 | AC_DEFINE_UNQUOTED([PRNGD_PORT], [$PRNGD_PORT], |
| 2778 | [Port number of PRNGD/EGD random number socket]) |
| 2779 | fi |
| 2780 | ] |
| 2781 | ) |
| 2782 | |
| 2783 | # PRNGD Unix domain socket |
| 2784 | AC_ARG_WITH([prngd-socket], |
| 2785 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 2786 | [ |
| 2787 | case "$withval" in |
| 2788 | yes) |
| 2789 | withval="/var/run/egd-pool" |
| 2790 | ;; |
| 2791 | no) |
| 2792 | withval="" |
| 2793 | ;; |
| 2794 | /*) |
| 2795 | ;; |
| 2796 | *) |
| 2797 | AC_MSG_ERROR([You must specify an absolute path to the entropy socket]) |
| 2798 | ;; |
| 2799 | esac |
| 2800 | |
| 2801 | if test ! -z "$withval" ; then |
| 2802 | if test ! -z "$PRNGD_PORT" ; then |
| 2803 | AC_MSG_ERROR([You may not specify both a PRNGD/EGD port and socket]) |
| 2804 | fi |
| 2805 | if test ! -r "$withval" ; then |
| 2806 | AC_MSG_WARN([Entropy socket is not readable]) |
| 2807 | fi |
| 2808 | PRNGD_SOCKET="$withval" |
| 2809 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"], |
| 2810 | [Location of PRNGD/EGD random number socket]) |
| 2811 | fi |
| 2812 | ], |
| 2813 | [ |
| 2814 | # Check for existing socket only if we don't have a random device already |
| 2815 | if test "x$OPENSSL_SEEDS_ITSELF" != "xyes" ; then |
| 2816 | AC_MSG_CHECKING([for PRNGD/EGD socket]) |
| 2817 | # Insert other locations here |
| 2818 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 2819 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 2820 | PRNGD_SOCKET="$sock" |
| 2821 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"]) |
| 2822 | break; |
| 2823 | fi |
| 2824 | done |
| 2825 | if test ! -z "$PRNGD_SOCKET" ; then |
| 2826 | AC_MSG_RESULT([$PRNGD_SOCKET]) |
| 2827 | else |
| 2828 | AC_MSG_RESULT([not found]) |
| 2829 | fi |
| 2830 | fi |
| 2831 | ] |
| 2832 | ) |
| 2833 | |
| 2834 | # Which randomness source do we use? |
| 2835 | if test ! -z "$PRNGD_PORT" ; then |
| 2836 | RAND_MSG="PRNGd port $PRNGD_PORT" |
| 2837 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 2838 | RAND_MSG="PRNGd socket $PRNGD_SOCKET" |
| 2839 | elif test ! -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 2840 | AC_DEFINE([OPENSSL_PRNG_ONLY], [1], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2841 | [Define if you want the OpenSSL internally seeded PRNG only]) |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 2842 | RAND_MSG="OpenSSL internal ONLY" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2843 | elif test "x$openssl" = "xno" ; then |
| 2844 | 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] | 2845 | else |
| 2846 | 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]) |
| 2847 | fi |
| 2848 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2849 | # Check for PAM libs |
| 2850 | PAM_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2851 | AC_ARG_WITH([pam], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2852 | [ --with-pam Enable PAM support ], |
| 2853 | [ |
| 2854 | if test "x$withval" != "xno" ; then |
| 2855 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ |
| 2856 | test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then |
| 2857 | AC_MSG_ERROR([PAM headers not found]) |
| 2858 | fi |
| 2859 | |
| 2860 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2861 | AC_CHECK_LIB([dl], [dlopen], , ) |
| 2862 | AC_CHECK_LIB([pam], [pam_set_item], , [AC_MSG_ERROR([*** libpam missing])]) |
| 2863 | AC_CHECK_FUNCS([pam_getenvlist]) |
| 2864 | AC_CHECK_FUNCS([pam_putenv]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2865 | LIBS="$saved_LIBS" |
| 2866 | |
| 2867 | PAM_MSG="yes" |
| 2868 | |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 2869 | SSHDLIBS="$SSHDLIBS -lpam" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2870 | AC_DEFINE([USE_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2871 | [Define if you want to enable PAM support]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2872 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2873 | if test $ac_cv_lib_dl_dlopen = yes; then |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2874 | case "$LIBS" in |
| 2875 | *-ldl*) |
| 2876 | # libdl already in LIBS |
| 2877 | ;; |
| 2878 | *) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 2879 | SSHDLIBS="$SSHDLIBS -ldl" |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2880 | ;; |
| 2881 | esac |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2882 | fi |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2883 | fi |
| 2884 | ] |
| 2885 | ) |
| 2886 | |
| 2887 | # Check for older PAM |
| 2888 | if test "x$PAM_MSG" = "xyes" ; then |
| 2889 | # Check PAM strerror arguments (old PAM) |
| 2890 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2891 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2892 | #include <stdlib.h> |
| 2893 | #if defined(HAVE_SECURITY_PAM_APPL_H) |
| 2894 | #include <security/pam_appl.h> |
| 2895 | #elif defined (HAVE_PAM_PAM_APPL_H) |
| 2896 | #include <pam/pam_appl.h> |
| 2897 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2898 | ]], [[ |
| 2899 | (void)pam_strerror((pam_handle_t *)NULL, -1); |
| 2900 | ]])], [AC_MSG_RESULT([no])], [ |
| 2901 | AC_DEFINE([HAVE_OLD_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2902 | [Define if you have an old version of PAM |
| 2903 | which takes only one argument to pam_strerror]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2904 | AC_MSG_RESULT([yes]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2905 | PAM_MSG="yes (old library)" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2906 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2907 | ]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2908 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2909 | |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 2910 | case "$host" in |
| 2911 | *-*-cygwin*) |
| 2912 | SSH_PRIVSEP_USER=CYGWIN_SSH_PRIVSEP_USER |
| 2913 | ;; |
| 2914 | *) |
| 2915 | SSH_PRIVSEP_USER=sshd |
| 2916 | ;; |
| 2917 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2918 | AC_ARG_WITH([privsep-user], |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 2919 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2920 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 2921 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 2922 | test "x${withval}" != "xyes"; then |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 2923 | SSH_PRIVSEP_USER=$withval |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2924 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2925 | ] |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2926 | ) |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 2927 | if test "x$SSH_PRIVSEP_USER" = "xCYGWIN_SSH_PRIVSEP_USER" ; then |
| 2928 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], [CYGWIN_SSH_PRIVSEP_USER], |
| 2929 | [Cygwin function to fetch non-privileged user for privilege separation]) |
| 2930 | else |
| 2931 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], ["$SSH_PRIVSEP_USER"], |
| 2932 | [non-privileged user for privilege separation]) |
| 2933 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2934 | AC_SUBST([SSH_PRIVSEP_USER]) |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2935 | |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 2936 | if test "x$have_linux_no_new_privs" = "x1" ; then |
| 2937 | AC_CHECK_DECL([SECCOMP_MODE_FILTER], [have_seccomp_filter=1], , [ |
| 2938 | #include <sys/types.h> |
| 2939 | #include <linux/seccomp.h> |
| 2940 | ]) |
| 2941 | fi |
| 2942 | if test "x$have_seccomp_filter" = "x1" ; then |
| 2943 | AC_MSG_CHECKING([kernel for seccomp_filter support]) |
| 2944 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2945 | #include <errno.h> |
| 2946 | #include <elf.h> |
| 2947 | #include <linux/audit.h> |
| 2948 | #include <linux/seccomp.h> |
| 2949 | #include <stdlib.h> |
| 2950 | #include <sys/prctl.h> |
| 2951 | ]], |
| 2952 | [[ int i = $seccomp_audit_arch; |
| 2953 | errno = 0; |
| 2954 | prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0); |
| 2955 | exit(errno == EFAULT ? 0 : 1); ]])], |
| 2956 | [ AC_MSG_RESULT([yes]) ], [ |
| 2957 | AC_MSG_RESULT([no]) |
| 2958 | # Disable seccomp filter as a target |
| 2959 | have_seccomp_filter=0 |
| 2960 | ] |
| 2961 | ) |
| 2962 | fi |
| 2963 | |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 2964 | # Decide which sandbox style to use |
| 2965 | sandbox_arg="" |
| 2966 | AC_ARG_WITH([sandbox], |
Damien Miller | 868ea1e | 2014-01-17 16:47:04 +1100 | [diff] [blame] | 2967 | [ --with-sandbox=style Specify privilege separation sandbox (no, darwin, rlimit, systrace, seccomp_filter, capsicum)], |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 2968 | [ |
| 2969 | if test "x$withval" = "xyes" ; then |
| 2970 | sandbox_arg="" |
| 2971 | else |
| 2972 | sandbox_arg="$withval" |
| 2973 | fi |
| 2974 | ] |
| 2975 | ) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 2976 | |
| 2977 | # Some platforms (seems to be the ones that have a kernel poll(2)-type |
| 2978 | # function with which they implement select(2)) use an extra file descriptor |
| 2979 | # when calling select(2), which means we can't use the rlimit sandbox. |
| 2980 | AC_MSG_CHECKING([if select works with descriptor rlimit]) |
| 2981 | AC_RUN_IFELSE( |
| 2982 | [AC_LANG_PROGRAM([[ |
| 2983 | #include <sys/types.h> |
| 2984 | #ifdef HAVE_SYS_TIME_H |
| 2985 | # include <sys/time.h> |
| 2986 | #endif |
| 2987 | #include <sys/resource.h> |
| 2988 | #ifdef HAVE_SYS_SELECT_H |
| 2989 | # include <sys/select.h> |
| 2990 | #endif |
| 2991 | #include <errno.h> |
| 2992 | #include <fcntl.h> |
| 2993 | #include <stdlib.h> |
| 2994 | ]],[[ |
| 2995 | struct rlimit rl_zero; |
| 2996 | int fd, r; |
| 2997 | fd_set fds; |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 2998 | struct timeval tv; |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 2999 | |
| 3000 | fd = open("/dev/null", O_RDONLY); |
| 3001 | FD_ZERO(&fds); |
| 3002 | FD_SET(fd, &fds); |
| 3003 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3004 | setrlimit(RLIMIT_FSIZE, &rl_zero); |
| 3005 | setrlimit(RLIMIT_NOFILE, &rl_zero); |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3006 | tv.tv_sec = 1; |
| 3007 | tv.tv_usec = 0; |
| 3008 | r = select(fd+1, &fds, NULL, NULL, &tv); |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3009 | exit (r == -1 ? 1 : 0); |
| 3010 | ]])], |
| 3011 | [AC_MSG_RESULT([yes]) |
| 3012 | select_works_with_rlimit=yes], |
| 3013 | [AC_MSG_RESULT([no]) |
| 3014 | select_works_with_rlimit=no], |
| 3015 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 3016 | ) |
| 3017 | |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3018 | AC_MSG_CHECKING([if setrlimit(RLIMIT_NOFILE,{0,0}) works]) |
| 3019 | AC_RUN_IFELSE( |
| 3020 | [AC_LANG_PROGRAM([[ |
| 3021 | #include <sys/types.h> |
| 3022 | #ifdef HAVE_SYS_TIME_H |
| 3023 | # include <sys/time.h> |
| 3024 | #endif |
| 3025 | #include <sys/resource.h> |
| 3026 | #include <errno.h> |
| 3027 | #include <stdlib.h> |
| 3028 | ]],[[ |
| 3029 | struct rlimit rl_zero; |
| 3030 | int fd, r; |
| 3031 | fd_set fds; |
| 3032 | |
| 3033 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3034 | r = setrlimit(RLIMIT_NOFILE, &rl_zero); |
| 3035 | exit (r == -1 ? 1 : 0); |
| 3036 | ]])], |
| 3037 | [AC_MSG_RESULT([yes]) |
| 3038 | rlimit_nofile_zero_works=yes], |
| 3039 | [AC_MSG_RESULT([no]) |
| 3040 | rlimit_nofile_zero_works=no], |
| 3041 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 3042 | ) |
| 3043 | |
Darren Tucker | d545a4b | 2012-07-03 22:48:31 +1000 | [diff] [blame] | 3044 | AC_MSG_CHECKING([if setrlimit RLIMIT_FSIZE works]) |
| 3045 | AC_RUN_IFELSE( |
| 3046 | [AC_LANG_PROGRAM([[ |
| 3047 | #include <sys/types.h> |
| 3048 | #include <sys/resource.h> |
| 3049 | #include <stdlib.h> |
| 3050 | ]],[[ |
| 3051 | struct rlimit rl_zero; |
| 3052 | |
| 3053 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3054 | exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0); |
| 3055 | ]])], |
| 3056 | [AC_MSG_RESULT([yes])], |
| 3057 | [AC_MSG_RESULT([no]) |
| 3058 | AC_DEFINE(SANDBOX_SKIP_RLIMIT_FSIZE, 1, |
| 3059 | [setrlimit RLIMIT_FSIZE works])], |
| 3060 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 3061 | ) |
| 3062 | |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3063 | if test "x$sandbox_arg" = "xsystrace" || \ |
| 3064 | ( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3065 | test "x$have_systr_policy_kill" != "x1" && \ |
| 3066 | 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] | 3067 | SANDBOX_STYLE="systrace" |
| 3068 | AC_DEFINE([SANDBOX_SYSTRACE], [1], [Sandbox using systrace(4)]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 3069 | elif test "x$sandbox_arg" = "xdarwin" || \ |
| 3070 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \ |
| 3071 | test "x$ac_cv_header_sandbox_h" = "xyes") ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3072 | test "x$ac_cv_func_sandbox_init" != "xyes" -o \ |
| 3073 | "x$ac_cv_header_sandbox_h" != "xyes" && \ |
| 3074 | 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] | 3075 | SANDBOX_STYLE="darwin" |
| 3076 | AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3077 | elif test "x$sandbox_arg" = "xseccomp_filter" || \ |
| 3078 | ( test -z "$sandbox_arg" && \ |
Darren Tucker | d0494fd | 2012-05-19 14:25:39 +1000 | [diff] [blame] | 3079 | test "x$have_seccomp_filter" = "x1" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3080 | test "x$ac_cv_header_elf_h" = "xyes" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3081 | test "x$ac_cv_header_linux_audit_h" = "xyes" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3082 | test "x$ac_cv_header_linux_filter_h" = "xyes" && \ |
| 3083 | test "x$seccomp_audit_arch" != "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3084 | test "x$have_linux_no_new_privs" = "x1" && \ |
| 3085 | test "x$ac_cv_func_prctl" = "xyes" ) ; then |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3086 | test "x$seccomp_audit_arch" = "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3087 | AC_MSG_ERROR([seccomp_filter sandbox not supported on $host]) |
| 3088 | test "x$have_linux_no_new_privs" != "x1" && \ |
| 3089 | AC_MSG_ERROR([seccomp_filter sandbox requires PR_SET_NO_NEW_PRIVS]) |
| 3090 | test "x$have_seccomp_filter" != "x1" && \ |
| 3091 | AC_MSG_ERROR([seccomp_filter sandbox requires seccomp headers]) |
| 3092 | test "x$ac_cv_func_prctl" != "xyes" && \ |
| 3093 | AC_MSG_ERROR([seccomp_filter sandbox requires prctl function]) |
| 3094 | SANDBOX_STYLE="seccomp_filter" |
| 3095 | AC_DEFINE([SANDBOX_SECCOMP_FILTER], [1], [Sandbox using seccomp filter]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3096 | elif test "x$sandbox_arg" = "xcapsicum" || \ |
| 3097 | ( test -z "$sandbox_arg" && \ |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3098 | test "x$ac_cv_header_sys_capability_h" = "xyes" && \ |
| 3099 | test "x$ac_cv_func_cap_rights_limit" = "xyes") ; then |
| 3100 | test "x$ac_cv_header_sys_capability_h" != "xyes" && \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 3101 | AC_MSG_ERROR([capsicum sandbox requires sys/capability.h header]) |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3102 | test "x$ac_cv_func_cap_rights_limit" != "xyes" && \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 3103 | AC_MSG_ERROR([capsicum sandbox requires cap_rights_limit function]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3104 | SANDBOX_STYLE="capsicum" |
| 3105 | AC_DEFINE([SANDBOX_CAPSICUM], [1], [Sandbox using capsicum]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3106 | elif test "x$sandbox_arg" = "xrlimit" || \ |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3107 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" && \ |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3108 | test "x$select_works_with_rlimit" = "xyes" && \ |
| 3109 | test "x$rlimit_nofile_zero_works" = "xyes" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3110 | test "x$ac_cv_func_setrlimit" != "xyes" && \ |
| 3111 | AC_MSG_ERROR([rlimit sandbox requires setrlimit function]) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3112 | test "x$select_works_with_rlimit" != "xyes" && \ |
| 3113 | AC_MSG_ERROR([rlimit sandbox requires select to work with rlimit]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3114 | SANDBOX_STYLE="rlimit" |
| 3115 | AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)]) |
| 3116 | elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \ |
| 3117 | test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then |
| 3118 | SANDBOX_STYLE="none" |
| 3119 | AC_DEFINE([SANDBOX_NULL], [1], [no privsep sandboxing]) |
| 3120 | else |
Tim Rice | a6e6061 | 2011-08-17 21:48:22 -0700 | [diff] [blame] | 3121 | AC_MSG_ERROR([unsupported --with-sandbox]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3122 | fi |
| 3123 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 3124 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 3125 | if test ! -z "$SONY" ; then |
| 3126 | LIBS="$LIBS -liberty"; |
| 3127 | fi |
| 3128 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3129 | # Check for long long datatypes |
| 3130 | AC_CHECK_TYPES([long long, unsigned long long, long double]) |
| 3131 | |
| 3132 | # Check datatype sizes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3133 | AC_CHECK_SIZEOF([short int], [2]) |
| 3134 | AC_CHECK_SIZEOF([int], [4]) |
| 3135 | AC_CHECK_SIZEOF([long int], [4]) |
| 3136 | AC_CHECK_SIZEOF([long long int], [8]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3137 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 3138 | # Sanity check long long for some platforms (AIX) |
| 3139 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 3140 | ac_cv_sizeof_long_long_int=0 |
| 3141 | fi |
| 3142 | |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3143 | # compute LLONG_MIN and LLONG_MAX if we don't know them. |
| 3144 | if test -z "$have_llong_max"; then |
| 3145 | AC_MSG_CHECKING([for max value of long long]) |
| 3146 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3147 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3148 | #include <stdio.h> |
| 3149 | /* Why is this so damn hard? */ |
| 3150 | #ifdef __GNUC__ |
| 3151 | # undef __GNUC__ |
| 3152 | #endif |
| 3153 | #define __USE_ISOC99 |
| 3154 | #include <limits.h> |
| 3155 | #define DATA "conftest.llminmax" |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3156 | #define my_abs(a) ((a) < 0 ? ((a) * -1) : (a)) |
| 3157 | |
| 3158 | /* |
| 3159 | * printf in libc on some platforms (eg old Tru64) does not understand %lld so |
| 3160 | * we do this the hard way. |
| 3161 | */ |
| 3162 | static int |
| 3163 | fprint_ll(FILE *f, long long n) |
| 3164 | { |
| 3165 | unsigned int i; |
| 3166 | int l[sizeof(long long) * 8]; |
| 3167 | |
| 3168 | if (n < 0) |
| 3169 | if (fprintf(f, "-") < 0) |
| 3170 | return -1; |
| 3171 | for (i = 0; n != 0; i++) { |
| 3172 | l[i] = my_abs(n % 10); |
| 3173 | n /= 10; |
| 3174 | } |
| 3175 | do { |
| 3176 | if (fprintf(f, "%d", l[--i]) < 0) |
| 3177 | return -1; |
| 3178 | } while (i != 0); |
| 3179 | if (fprintf(f, " ") < 0) |
| 3180 | return -1; |
| 3181 | return 0; |
| 3182 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3183 | ]], [[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3184 | FILE *f; |
| 3185 | long long i, llmin, llmax = 0; |
| 3186 | |
| 3187 | if((f = fopen(DATA,"w")) == NULL) |
| 3188 | exit(1); |
| 3189 | |
| 3190 | #if defined(LLONG_MIN) && defined(LLONG_MAX) |
| 3191 | fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); |
| 3192 | llmin = LLONG_MIN; |
| 3193 | llmax = LLONG_MAX; |
| 3194 | #else |
| 3195 | fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); |
| 3196 | /* This will work on one's complement and two's complement */ |
| 3197 | for (i = 1; i > llmax; i <<= 1, i++) |
| 3198 | llmax = i; |
| 3199 | llmin = llmax + 1LL; /* wrap */ |
| 3200 | #endif |
| 3201 | |
| 3202 | /* Sanity check */ |
| 3203 | if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3204 | || llmax - 1 > llmax || llmin == llmax || llmin == 0 |
| 3205 | || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) { |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3206 | fprintf(f, "unknown unknown\n"); |
| 3207 | exit(2); |
| 3208 | } |
| 3209 | |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3210 | if (fprint_ll(f, llmin) < 0) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3211 | exit(3); |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3212 | if (fprint_ll(f, llmax) < 0) |
| 3213 | exit(4); |
| 3214 | if (fclose(f) < 0) |
| 3215 | exit(5); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3216 | exit(0); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3217 | ]])], |
| 3218 | [ |
| 3219 | llong_min=`$AWK '{print $1}' conftest.llminmax` |
| 3220 | llong_max=`$AWK '{print $2}' conftest.llminmax` |
| 3221 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3222 | AC_MSG_RESULT([$llong_max]) |
| 3223 | AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3224 | [max value of long long calculated by configure]) |
| 3225 | AC_MSG_CHECKING([for min value of long long]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3226 | AC_MSG_RESULT([$llong_min]) |
| 3227 | AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3228 | [min value of long long calculated by configure]) |
| 3229 | ], |
| 3230 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3231 | AC_MSG_RESULT([not found]) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3232 | ], |
| 3233 | [ |
| 3234 | AC_MSG_WARN([cross compiling: not checking]) |
| 3235 | ] |
| 3236 | ) |
| 3237 | fi |
| 3238 | |
| 3239 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3240 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3241 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3242 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3243 | [[ u_int a; a = 1;]])], |
| 3244 | [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no" |
| 3245 | ]) |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3246 | ]) |
| 3247 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3248 | 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] | 3249 | have_u_int=1 |
| 3250 | fi |
| 3251 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3252 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3253 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3254 | [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])], |
| 3255 | [ ac_cv_have_intxx_t="yes" ], [ ac_cv_have_intxx_t="no" |
| 3256 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3257 | ]) |
| 3258 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3259 | 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] | 3260 | have_intxx_t=1 |
| 3261 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3262 | |
| 3263 | if (test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3264 | test "x$ac_cv_header_stdint_h" = "xyes") |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3265 | then |
| 3266 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3267 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3268 | [[ 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] | 3269 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3270 | AC_DEFINE([HAVE_INTXX_T]) |
| 3271 | AC_MSG_RESULT([yes]) |
| 3272 | ], [ AC_MSG_RESULT([no]) |
| 3273 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3274 | fi |
| 3275 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3276 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3277 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | 907881e | 2002-07-18 11:44:50 -0700 | [diff] [blame] | 3278 | #include <sys/types.h> |
| 3279 | #ifdef HAVE_STDINT_H |
| 3280 | # include <stdint.h> |
| 3281 | #endif |
| 3282 | #include <sys/socket.h> |
| 3283 | #ifdef HAVE_SYS_BITYPES_H |
| 3284 | # include <sys/bitypes.h> |
| 3285 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3286 | ]], [[ |
| 3287 | int64_t a; a = 1; |
| 3288 | ]])], |
| 3289 | [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no" |
| 3290 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3291 | ]) |
| 3292 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3293 | 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] | 3294 | fi |
| 3295 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3296 | 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] | 3297 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3298 | [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])], |
| 3299 | [ ac_cv_have_u_intxx_t="yes" ], [ ac_cv_have_u_intxx_t="no" |
| 3300 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3301 | ]) |
| 3302 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3303 | 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] | 3304 | have_u_intxx_t=1 |
| 3305 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3306 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3307 | if test -z "$have_u_intxx_t" ; then |
| 3308 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3309 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]], |
| 3310 | [[ 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] | 3311 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3312 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3313 | AC_MSG_RESULT([yes]) |
| 3314 | ], [ AC_MSG_RESULT([no]) |
| 3315 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3316 | fi |
| 3317 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3318 | 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] | 3319 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3320 | [[ u_int64_t a; a = 1;]])], |
| 3321 | [ ac_cv_have_u_int64_t="yes" ], [ ac_cv_have_u_int64_t="no" |
| 3322 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3323 | ]) |
| 3324 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3325 | 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] | 3326 | have_u_int64_t=1 |
| 3327 | fi |
| 3328 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3329 | if (test -z "$have_u_int64_t" && \ |
| 3330 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
| 3331 | then |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3332 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3333 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]], |
| 3334 | [[ u_int64_t a; a = 1]])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3335 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3336 | AC_DEFINE([HAVE_U_INT64_T]) |
| 3337 | AC_MSG_RESULT([yes]) |
| 3338 | ], [ AC_MSG_RESULT([no]) |
| 3339 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3340 | fi |
| 3341 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3342 | if test -z "$have_u_intxx_t" ; then |
| 3343 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3344 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3345 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3346 | ]], [[ |
| 3347 | uint8_t a; |
| 3348 | uint16_t b; |
| 3349 | uint32_t c; |
| 3350 | a = b = c = 1; |
| 3351 | ]])], |
| 3352 | [ ac_cv_have_uintxx_t="yes" ], [ ac_cv_have_uintxx_t="no" |
| 3353 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3354 | ]) |
| 3355 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3356 | AC_DEFINE([HAVE_UINTXX_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3357 | [define if you have uintxx_t data type]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3358 | fi |
| 3359 | fi |
| 3360 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3361 | if (test -z "$have_uintxx_t" && \ |
| 3362 | test "x$ac_cv_header_stdint_h" = "xyes") |
| 3363 | then |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3364 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3365 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3366 | [[ 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] | 3367 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3368 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3369 | AC_MSG_RESULT([yes]) |
| 3370 | ], [ AC_MSG_RESULT([no]) |
| 3371 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3372 | fi |
| 3373 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3374 | if (test -z "$have_uintxx_t" && \ |
| 3375 | test "x$ac_cv_header_inttypes_h" = "xyes") |
| 3376 | then |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3377 | AC_MSG_CHECKING([for uintXX_t types in inttypes.h]) |
| 3378 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <inttypes.h> ]], |
| 3379 | [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;]])], |
| 3380 | [ |
| 3381 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3382 | AC_MSG_RESULT([yes]) |
| 3383 | ], [ AC_MSG_RESULT([no]) |
| 3384 | ]) |
| 3385 | fi |
| 3386 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 3387 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3388 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3389 | then |
| 3390 | 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] | 3391 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3392 | #include <sys/bitypes.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3393 | ]], [[ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 3394 | int8_t a; int16_t b; int32_t c; |
| 3395 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 3396 | a = b = c = e = f = g = 1; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3397 | ]])], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3398 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3399 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3400 | AC_DEFINE([HAVE_INTXX_T]) |
| 3401 | AC_MSG_RESULT([yes]) |
| 3402 | ], [AC_MSG_RESULT([no]) |
| 3403 | ]) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3404 | fi |
| 3405 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3406 | |
| 3407 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3408 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3409 | [[ u_char foo; foo = 125; ]])], |
| 3410 | [ ac_cv_have_u_char="yes" ], [ ac_cv_have_u_char="no" |
| 3411 | ]) |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3412 | ]) |
| 3413 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3414 | 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] | 3415 | fi |
| 3416 | |
Darren Tucker | 007e3b3 | 2013-11-03 18:43:55 +1100 | [diff] [blame] | 3417 | AC_CHECK_TYPES([intmax_t, uintmax_t], , , [ |
| 3418 | #include <sys/types.h> |
| 3419 | #include <stdint.h> |
| 3420 | ]) |
| 3421 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3422 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 3423 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3424 | AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>]) |
| 3425 | AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 3426 | #include <sys/types.h> |
| 3427 | #ifdef HAVE_SYS_BITYPES_H |
| 3428 | #include <sys/bitypes.h> |
| 3429 | #endif |
| 3430 | #ifdef HAVE_SYS_STATFS_H |
| 3431 | #include <sys/statfs.h> |
| 3432 | #endif |
| 3433 | #ifdef HAVE_SYS_STATVFS_H |
| 3434 | #include <sys/statvfs.h> |
| 3435 | #endif |
| 3436 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3437 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3438 | AC_CHECK_TYPES([in_addr_t, in_port_t], , , |
Damien Miller | 848b993 | 2005-02-24 12:12:34 +1100 | [diff] [blame] | 3439 | [#include <sys/types.h> |
| 3440 | #include <netinet/in.h>]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 3441 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3442 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3443 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3444 | [[ size_t foo; foo = 1235; ]])], |
| 3445 | [ ac_cv_have_size_t="yes" ], [ ac_cv_have_size_t="no" |
| 3446 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3447 | ]) |
| 3448 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3449 | 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] | 3450 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 3451 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3452 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3453 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3454 | [[ ssize_t foo; foo = 1235; ]])], |
| 3455 | [ ac_cv_have_ssize_t="yes" ], [ ac_cv_have_ssize_t="no" |
| 3456 | ]) |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3457 | ]) |
| 3458 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3459 | 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] | 3460 | fi |
| 3461 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3462 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3463 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <time.h> ]], |
| 3464 | [[ clock_t foo; foo = 1235; ]])], |
| 3465 | [ ac_cv_have_clock_t="yes" ], [ ac_cv_have_clock_t="no" |
| 3466 | ]) |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3467 | ]) |
| 3468 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3469 | 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] | 3470 | fi |
| 3471 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3472 | 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] | 3473 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3474 | #include <sys/types.h> |
| 3475 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3476 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
| 3477 | [ ac_cv_have_sa_family_t="yes" ], |
| 3478 | [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3479 | #include <sys/types.h> |
| 3480 | #include <sys/socket.h> |
| 3481 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3482 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3483 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3484 | [ ac_cv_have_sa_family_t="no" ] |
| 3485 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3486 | ]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3487 | ]) |
| 3488 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3489 | AC_DEFINE([HAVE_SA_FAMILY_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3490 | [define if you have sa_family_t data type]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3491 | fi |
| 3492 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3493 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3494 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3495 | [[ pid_t foo; foo = 1235; ]])], |
| 3496 | [ ac_cv_have_pid_t="yes" ], [ ac_cv_have_pid_t="no" |
| 3497 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3498 | ]) |
| 3499 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3500 | 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] | 3501 | fi |
| 3502 | |
| 3503 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3504 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3505 | [[ mode_t foo; foo = 1235; ]])], |
| 3506 | [ ac_cv_have_mode_t="yes" ], [ ac_cv_have_mode_t="no" |
| 3507 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3508 | ]) |
| 3509 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3510 | 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] | 3511 | fi |
| 3512 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3513 | |
| 3514 | 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] | 3515 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3516 | #include <sys/types.h> |
| 3517 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3518 | ]], [[ struct sockaddr_storage s; ]])], |
| 3519 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 3520 | [ ac_cv_have_struct_sockaddr_storage="no" |
| 3521 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3522 | ]) |
| 3523 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3524 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3525 | [define if you have struct sockaddr_storage data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3526 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3527 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3528 | 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] | 3529 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3530 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3531 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3532 | ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])], |
| 3533 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 3534 | [ ac_cv_have_struct_sockaddr_in6="no" |
| 3535 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3536 | ]) |
| 3537 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3538 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_IN6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3539 | [define if you have struct sockaddr_in6 data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3540 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3541 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3542 | 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] | 3543 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3544 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3545 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3546 | ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])], |
| 3547 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 3548 | [ ac_cv_have_struct_in6_addr="no" |
| 3549 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3550 | ]) |
| 3551 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3552 | AC_DEFINE([HAVE_STRUCT_IN6_ADDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3553 | [define if you have struct in6_addr data type]) |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3554 | |
| 3555 | dnl Now check for sin6_scope_id |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3556 | AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , , |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3557 | [ |
| 3558 | #ifdef HAVE_SYS_TYPES_H |
| 3559 | #include <sys/types.h> |
| 3560 | #endif |
| 3561 | #include <netinet/in.h> |
| 3562 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3563 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3564 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3565 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3566 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3567 | #include <sys/types.h> |
| 3568 | #include <sys/socket.h> |
| 3569 | #include <netdb.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3570 | ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])], |
| 3571 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 3572 | [ ac_cv_have_struct_addrinfo="no" |
| 3573 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3574 | ]) |
| 3575 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3576 | AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3577 | [define if you have struct addrinfo data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3578 | fi |
| 3579 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3580 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3581 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], |
| 3582 | [[ struct timeval tv; tv.tv_sec = 1;]])], |
| 3583 | [ ac_cv_have_struct_timeval="yes" ], |
| 3584 | [ ac_cv_have_struct_timeval="no" |
| 3585 | ]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3586 | ]) |
| 3587 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3588 | AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3589 | have_struct_timeval=1 |
| 3590 | fi |
| 3591 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3592 | AC_CHECK_TYPES([struct timespec]) |
Tim Rice | 4e4dc56 | 2003-03-18 10:21:40 -0800 | [diff] [blame] | 3593 | |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3594 | # 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] | 3595 | if test "x$ac_cv_have_int64_t" = "xno" && \ |
| 3596 | test "x$ac_cv_sizeof_long_int" != "x8" && \ |
| 3597 | test "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3598 | echo "OpenSSH requires int64_t support. Contact your vendor or install" |
| 3599 | echo "an alternative compiler (I.E., GCC) before continuing." |
| 3600 | echo "" |
| 3601 | exit 1; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3602 | else |
| 3603 | dnl test snprintf (broken on SCO w/gcc) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3604 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3605 | [AC_LANG_SOURCE([[ |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3606 | #include <stdio.h> |
| 3607 | #include <string.h> |
| 3608 | #ifdef HAVE_SNPRINTF |
| 3609 | main() |
| 3610 | { |
| 3611 | char buf[50]; |
| 3612 | char expected_out[50]; |
| 3613 | int mazsize = 50 ; |
| 3614 | #if (SIZEOF_LONG_INT == 8) |
| 3615 | long int num = 0x7fffffffffffffff; |
| 3616 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 3617 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3618 | #endif |
| 3619 | strcpy(expected_out, "9223372036854775807"); |
| 3620 | snprintf(buf, mazsize, "%lld", num); |
| 3621 | if(strcmp(buf, expected_out) != 0) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3622 | exit(1); |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3623 | exit(0); |
| 3624 | } |
| 3625 | #else |
| 3626 | main() { exit(0); } |
| 3627 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3628 | ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3629 | AC_MSG_WARN([cross compiling: Assuming working snprintf()]) |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3630 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 3631 | fi |
| 3632 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3633 | dnl Checks for structure members |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3634 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmp.h], [HAVE_HOST_IN_UTMP]) |
| 3635 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmpx.h], [HAVE_HOST_IN_UTMPX]) |
| 3636 | OSSH_CHECK_HEADER_FOR_FIELD([syslen], [utmpx.h], [HAVE_SYSLEN_IN_UTMPX]) |
| 3637 | OSSH_CHECK_HEADER_FOR_FIELD([ut_pid], [utmp.h], [HAVE_PID_IN_UTMP]) |
| 3638 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmp.h], [HAVE_TYPE_IN_UTMP]) |
| 3639 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmpx.h], [HAVE_TYPE_IN_UTMPX]) |
| 3640 | OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmp.h], [HAVE_TV_IN_UTMP]) |
| 3641 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmp.h], [HAVE_ID_IN_UTMP]) |
| 3642 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmpx.h], [HAVE_ID_IN_UTMPX]) |
| 3643 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP]) |
| 3644 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX]) |
| 3645 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP]) |
| 3646 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX]) |
| 3647 | OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP]) |
| 3648 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP]) |
| 3649 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX]) |
| 3650 | 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] | 3651 | |
| 3652 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3653 | AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, |
| 3654 | struct passwd.pw_change, struct passwd.pw_expire], |
| 3655 | [], [], [[ |
| 3656 | #include <sys/types.h> |
| 3657 | #include <pwd.h> |
| 3658 | ]]) |
| 3659 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3660 | AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state], |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3661 | [Define if we don't have struct __res_state in resolv.h])], |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3662 | [[ |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3663 | #include <stdio.h> |
| 3664 | #if HAVE_SYS_TYPES_H |
| 3665 | # include <sys/types.h> |
| 3666 | #endif |
| 3667 | #include <netinet/in.h> |
| 3668 | #include <arpa/nameser.h> |
| 3669 | #include <resolv.h> |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3670 | ]]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3671 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3672 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 3673 | ac_cv_have_ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3674 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3675 | #include <sys/types.h> |
| 3676 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3677 | ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])], |
| 3678 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 3679 | [ ac_cv_have_ss_family_in_struct_ss="no" ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3680 | ]) |
| 3681 | 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] | 3682 | 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] | 3683 | fi |
| 3684 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3685 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 3686 | ac_cv_have___ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3687 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3688 | #include <sys/types.h> |
| 3689 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3690 | ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])], |
| 3691 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 3692 | [ ac_cv_have___ss_family_in_struct_ss="no" |
| 3693 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3694 | ]) |
| 3695 | 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] | 3696 | AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3697 | [Fields in struct sockaddr_storage]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3698 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 3699 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3700 | 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] | 3701 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 3702 | ac_cv_have_accrights_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3703 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3704 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3705 | #include <sys/socket.h> |
| 3706 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3707 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3708 | #ifdef msg_accrights |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3709 | #error "msg_accrights is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3710 | exit(1); |
| 3711 | #endif |
| 3712 | struct msghdr m; |
| 3713 | m.msg_accrights = 0; |
| 3714 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3715 | ]])], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3716 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 3717 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 3718 | ) |
| 3719 | ]) |
| 3720 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3721 | AC_DEFINE([HAVE_ACCRIGHTS_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3722 | [Define if your system uses access rights style |
| 3723 | file descriptor passing]) |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3724 | fi |
| 3725 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3726 | AC_MSG_CHECKING([if struct statvfs.f_fsid is integral type]) |
| 3727 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e1a3ddf | 2012-05-04 11:05:45 +1000 | [diff] [blame] | 3728 | #include <sys/param.h> |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3729 | #include <sys/stat.h> |
| 3730 | #ifdef HAVE_SYS_TIME_H |
| 3731 | # include <sys/time.h> |
| 3732 | #endif |
| 3733 | #ifdef HAVE_SYS_MOUNT_H |
| 3734 | #include <sys/mount.h> |
| 3735 | #endif |
| 3736 | #ifdef HAVE_SYS_STATVFS_H |
| 3737 | #include <sys/statvfs.h> |
| 3738 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3739 | ]], [[ struct statvfs s; s.f_fsid = 0; ]])], |
| 3740 | [ AC_MSG_RESULT([yes]) ], |
| 3741 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3742 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3743 | AC_MSG_CHECKING([if fsid_t has member val]) |
| 3744 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3745 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3746 | #include <sys/statvfs.h> |
| 3747 | ]], [[ fsid_t t; t.val[0] = 0; ]])], |
| 3748 | [ AC_MSG_RESULT([yes]) |
| 3749 | AC_DEFINE([FSID_HAS_VAL], [1], [fsid_t has member val]) ], |
| 3750 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3751 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3752 | AC_MSG_CHECKING([if f_fsid has member __val]) |
| 3753 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3754 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3755 | #include <sys/statvfs.h> |
| 3756 | ]], [[ fsid_t t; t.__val[0] = 0; ]])], |
| 3757 | [ AC_MSG_RESULT([yes]) |
| 3758 | AC_DEFINE([FSID_HAS___VAL], [1], [fsid_t has member __val]) ], |
| 3759 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3760 | ]) |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 3761 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3762 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 3763 | ac_cv_have_control_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3764 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3765 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3766 | #include <sys/socket.h> |
| 3767 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3768 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3769 | #ifdef msg_control |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3770 | #error "msg_control is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3771 | exit(1); |
| 3772 | #endif |
| 3773 | struct msghdr m; |
| 3774 | m.msg_control = 0; |
| 3775 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3776 | ]])], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3777 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 3778 | [ ac_cv_have_control_in_msghdr="no" ] |
| 3779 | ) |
| 3780 | ]) |
| 3781 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3782 | AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3783 | [Define if your system uses ancillary data style |
| 3784 | file descriptor passing]) |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3785 | fi |
| 3786 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3787 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3788 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 3789 | [[ extern char *__progname; printf("%s", __progname); ]])], |
| 3790 | [ ac_cv_libc_defines___progname="yes" ], |
| 3791 | [ ac_cv_libc_defines___progname="no" |
| 3792 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3793 | ]) |
| 3794 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3795 | AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3796 | fi |
| 3797 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3798 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3799 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 3800 | [[ printf("%s", __FUNCTION__); ]])], |
| 3801 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
| 3802 | [ ac_cv_cc_implements___FUNCTION__="no" |
| 3803 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3804 | ]) |
| 3805 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3806 | AC_DEFINE([HAVE___FUNCTION__], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3807 | [Define if compiler implements __FUNCTION__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3808 | fi |
| 3809 | |
| 3810 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3811 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 3812 | [[ printf("%s", __func__); ]])], |
| 3813 | [ ac_cv_cc_implements___func__="yes" ], |
| 3814 | [ ac_cv_cc_implements___func__="no" |
| 3815 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3816 | ]) |
| 3817 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3818 | AC_DEFINE([HAVE___func__], [1], [Define if compiler implements __func__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3819 | fi |
| 3820 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3821 | AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3822 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3823 | #include <stdarg.h> |
| 3824 | va_list x,y; |
| 3825 | ]], [[ va_copy(x,y); ]])], |
| 3826 | [ ac_cv_have_va_copy="yes" ], |
| 3827 | [ ac_cv_have_va_copy="no" |
| 3828 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3829 | ]) |
| 3830 | if test "x$ac_cv_have_va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3831 | AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3832 | fi |
| 3833 | |
| 3834 | AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3835 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3836 | #include <stdarg.h> |
| 3837 | va_list x,y; |
| 3838 | ]], [[ __va_copy(x,y); ]])], |
| 3839 | [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no" |
| 3840 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3841 | ]) |
| 3842 | if test "x$ac_cv_have___va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3843 | AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3844 | fi |
| 3845 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 3846 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 3847 | ac_cv_have_getopt_optreset, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3848 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <getopt.h> ]], |
| 3849 | [[ extern int optreset; optreset = 0; ]])], |
| 3850 | [ ac_cv_have_getopt_optreset="yes" ], |
| 3851 | [ ac_cv_have_getopt_optreset="no" |
| 3852 | ]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 3853 | ]) |
| 3854 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3855 | AC_DEFINE([HAVE_GETOPT_OPTRESET], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3856 | [Define if your getopt(3) defines and uses optreset]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 3857 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3858 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 3859 | 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] | 3860 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 3861 | [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])], |
| 3862 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
| 3863 | [ ac_cv_libc_defines_sys_errlist="no" |
| 3864 | ]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 3865 | ]) |
| 3866 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3867 | AC_DEFINE([HAVE_SYS_ERRLIST], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3868 | [Define if your system defines sys_errlist[]]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 3869 | fi |
| 3870 | |
| 3871 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 3872 | 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] | 3873 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 3874 | [[ extern int sys_nerr; printf("%i", sys_nerr);]])], |
| 3875 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
| 3876 | [ ac_cv_libc_defines_sys_nerr="no" |
| 3877 | ]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 3878 | ]) |
| 3879 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3880 | 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] | 3881 | fi |
| 3882 | |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3883 | # Check libraries needed by DNS fingerprint support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3884 | AC_SEARCH_LIBS([getrrsetbyname], [resolv], |
| 3885 | [AC_DEFINE([HAVE_GETRRSETBYNAME], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3886 | [Define if getrrsetbyname() exists])], |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 3887 | [ |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3888 | # Needed by our getrrsetbyname() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3889 | AC_SEARCH_LIBS([res_query], [resolv]) |
| 3890 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
| 3891 | AC_MSG_CHECKING([if res_query will link]) |
| 3892 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 3893 | #include <sys/types.h> |
| 3894 | #include <netinet/in.h> |
| 3895 | #include <arpa/nameser.h> |
| 3896 | #include <netdb.h> |
| 3897 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3898 | ]], [[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 3899 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3900 | ]])], |
| 3901 | AC_MSG_RESULT([yes]), |
| 3902 | [AC_MSG_RESULT([no]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3903 | saved_LIBS="$LIBS" |
| 3904 | LIBS="$LIBS -lresolv" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3905 | AC_MSG_CHECKING([for res_query in -lresolv]) |
| 3906 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 3907 | #include <sys/types.h> |
| 3908 | #include <netinet/in.h> |
| 3909 | #include <arpa/nameser.h> |
| 3910 | #include <netdb.h> |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3911 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3912 | ]], [[ |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3913 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3914 | ]])], |
| 3915 | [AC_MSG_RESULT([yes])], |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3916 | [LIBS="$saved_LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3917 | AC_MSG_RESULT([no])]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3918 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3919 | AC_CHECK_FUNCS([_getshort _getlong]) |
Darren Tucker | d886e1c | 2005-06-01 18:57:45 +1000 | [diff] [blame] | 3920 | AC_CHECK_DECLS([_getshort, _getlong], , , |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 3921 | [#include <sys/types.h> |
| 3922 | #include <arpa/nameser.h>]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3923 | AC_CHECK_MEMBER([HEADER.ad], |
| 3924 | [AC_DEFINE([HAVE_HEADER_AD], [1], |
| 3925 | [Define if HEADER.ad exists in arpa/nameser.h])], , |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3926 | [#include <arpa/nameser.h>]) |
| 3927 | ]) |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 3928 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3929 | AC_MSG_CHECKING([if struct __res_state _res is an extern]) |
| 3930 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 3931 | #include <stdio.h> |
| 3932 | #if HAVE_SYS_TYPES_H |
| 3933 | # include <sys/types.h> |
| 3934 | #endif |
| 3935 | #include <netinet/in.h> |
| 3936 | #include <arpa/nameser.h> |
| 3937 | #include <resolv.h> |
| 3938 | extern struct __res_state _res; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3939 | ]], [[ ]])], |
| 3940 | [AC_MSG_RESULT([yes]) |
| 3941 | AC_DEFINE([HAVE__RES_EXTERN], [1], |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 3942 | [Define if you have struct __res_state _res as an extern]) |
| 3943 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3944 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 3945 | ) |
| 3946 | |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3947 | # Check whether user wants SELinux support |
| 3948 | SELINUX_MSG="no" |
| 3949 | LIBSELINUX="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3950 | AC_ARG_WITH([selinux], |
Damien Miller | 5b1c8b3 | 2008-03-27 12:33:07 +1100 | [diff] [blame] | 3951 | [ --with-selinux Enable SELinux support], |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3952 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3953 | save_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3954 | AC_DEFINE([WITH_SELINUX], [1], |
| 3955 | [Define if you want SELinux support.]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3956 | SELINUX_MSG="yes" |
| 3957 | AC_CHECK_HEADER([selinux/selinux.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3958 | AC_MSG_ERROR([SELinux support requires selinux.h header])) |
| 3959 | AC_CHECK_LIB([selinux], [setexeccon], |
Damien Miller | 1d2bfc4 | 2010-02-10 10:19:29 +1100 | [diff] [blame] | 3960 | [ LIBSELINUX="-lselinux" |
| 3961 | LIBS="$LIBS -lselinux" |
| 3962 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3963 | AC_MSG_ERROR([SELinux support requires libselinux library])) |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 3964 | SSHLIBS="$SSHLIBS $LIBSELINUX" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3965 | SSHDLIBS="$SSHDLIBS $LIBSELINUX" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3966 | AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level]) |
Darren Tucker | adc947d | 2006-10-07 09:07:20 +1000 | [diff] [blame] | 3967 | LIBS="$save_LIBS" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3968 | fi ] |
| 3969 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3970 | AC_SUBST([SSHLIBS]) |
| 3971 | AC_SUBST([SSHDLIBS]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3972 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 3973 | # Check whether user wants Kerberos 5 support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3974 | KRB5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3975 | AC_ARG_WITH([kerberos5], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3976 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3977 | [ if test "x$withval" != "xno" ; then |
| 3978 | if test "x$withval" = "xyes" ; then |
| 3979 | KRB5ROOT="/usr/local" |
| 3980 | else |
| 3981 | KRB5ROOT=${withval} |
| 3982 | fi |
| 3983 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3984 | AC_DEFINE([KRB5], [1], [Define if you want Kerberos 5 support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3985 | KRB5_MSG="yes" |
| 3986 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3987 | AC_PATH_PROG([KRB5CONF], [krb5-config], |
Darren Tucker | dad48e7 | 2009-09-01 18:26:00 +1000 | [diff] [blame] | 3988 | [$KRB5ROOT/bin/krb5-config], |
| 3989 | [$KRB5ROOT/bin:$PATH]) |
| 3990 | if test -x $KRB5CONF ; then |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 3991 | K5CFLAGS="`$KRB5CONF --cflags`" |
| 3992 | K5LIBS="`$KRB5CONF --libs`" |
| 3993 | CPPFLAGS="$CPPFLAGS $K5CFLAGS" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3994 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3995 | AC_MSG_CHECKING([for gssapi support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3996 | if $KRB5CONF | grep gssapi >/dev/null ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3997 | AC_MSG_RESULT([yes]) |
| 3998 | AC_DEFINE([GSSAPI], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3999 | [Define this if you want GSSAPI |
| 4000 | support in the version 2 protocol]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4001 | GSSCFLAGS="`$KRB5CONF --cflags gssapi`" |
| 4002 | GSSLIBS="`$KRB5CONF --libs gssapi`" |
| 4003 | CPPFLAGS="$CPPFLAGS $GSSCFLAGS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4004 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4005 | AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4006 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4007 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4008 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4009 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4010 | [ AC_MSG_RESULT([yes]) |
| 4011 | AC_DEFINE([HEIMDAL], [1], |
| 4012 | [Define this if you are using the Heimdal |
| 4013 | version of Kerberos V5]) ], |
| 4014 | [AC_MSG_RESULT([no]) |
| 4015 | ]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4016 | else |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4017 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4018 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4019 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4020 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4021 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4022 | [ AC_MSG_RESULT([yes]) |
| 4023 | AC_DEFINE([HEIMDAL]) |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4024 | K5LIBS="-lkrb5" |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4025 | K5LIBS="$K5LIBS -lcom_err -lasn1" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4026 | AC_CHECK_LIB([roken], [net_write], |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4027 | [K5LIBS="$K5LIBS -lroken"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4028 | AC_CHECK_LIB([des], [des_cbc_encrypt], |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4029 | [K5LIBS="$K5LIBS -ldes"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4030 | ], [ AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4031 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4032 | |
| 4033 | ]) |
| 4034 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4035 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4036 | AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context], |
| 4037 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4038 | GSSLIBS="-lgssapi_krb5" ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4039 | [ AC_CHECK_LIB([gssapi], [gss_init_sec_context], |
| 4040 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4041 | GSSLIBS="-lgssapi" ], |
Darren Tucker | a2b5a4c | 2013-02-22 10:43:15 +1100 | [diff] [blame] | 4042 | [ AC_CHECK_LIB([gss], [gss_init_sec_context], |
| 4043 | [ AC_DEFINE([GSSAPI]) |
| 4044 | GSSLIBS="-lgss" ], |
| 4045 | AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail])) |
| 4046 | ]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4047 | ]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4048 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4049 | AC_CHECK_HEADER([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4050 | [ unset ac_cv_header_gssapi_h |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4051 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4052 | AC_CHECK_HEADERS([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4053 | 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] | 4054 | ) |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4055 | ] |
| 4056 | ) |
| 4057 | |
| 4058 | oldCPP="$CPPFLAGS" |
| 4059 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4060 | AC_CHECK_HEADER([gssapi_krb5.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4061 | [ CPPFLAGS="$oldCPP" ]) |
| 4062 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4063 | fi |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4064 | if test ! -z "$need_dash_r" ; then |
| 4065 | LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" |
| 4066 | fi |
| 4067 | if test ! -z "$blibpath" ; then |
| 4068 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 4069 | fi |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4070 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4071 | AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h]) |
| 4072 | AC_CHECK_HEADERS([gssapi_krb5.h gssapi/gssapi_krb5.h]) |
| 4073 | AC_CHECK_HEADERS([gssapi_generic.h gssapi/gssapi_generic.h]) |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4074 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4075 | AC_SEARCH_LIBS([k_hasafs], [kafs], [AC_DEFINE([USE_AFS], [1], |
| 4076 | [Define this if you want to use libkafs' AFS support])]) |
Darren Tucker | 03978c6 | 2013-02-25 11:24:44 +1100 | [diff] [blame] | 4077 | |
| 4078 | AC_CHECK_DECLS([GSS_C_NT_HOSTBASED_SERVICE], [], [], [[ |
| 4079 | #ifdef HAVE_GSSAPI_H |
| 4080 | # include <gssapi.h> |
| 4081 | #elif defined(HAVE_GSSAPI_GSSAPI_H) |
| 4082 | # include <gssapi/gssapi.h> |
| 4083 | #endif |
| 4084 | |
| 4085 | #ifdef HAVE_GSSAPI_GENERIC_H |
| 4086 | # include <gssapi_generic.h> |
| 4087 | #elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H) |
| 4088 | # include <gssapi/gssapi_generic.h> |
| 4089 | #endif |
| 4090 | ]]) |
Darren Tucker | f3ab2c5 | 2013-08-04 21:48:41 +1000 | [diff] [blame] | 4091 | saved_LIBS="$LIBS" |
| 4092 | LIBS="$LIBS $K5LIBS" |
| 4093 | AC_CHECK_FUNCS([krb5_cc_new_unique krb5_get_error_message krb5_free_error_message]) |
| 4094 | LIBS="$saved_LIBS" |
| 4095 | |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4096 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4097 | ] |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4098 | ) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4099 | AC_SUBST([GSSLIBS]) |
| 4100 | AC_SUBST([K5LIBS]) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 4101 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4102 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4103 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4104 | PRIVSEP_PATH=/var/empty |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4105 | AC_ARG_WITH([privsep-path], |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 4106 | [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4107 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4108 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4109 | test "x${withval}" != "xyes"; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4110 | PRIVSEP_PATH=$withval |
| 4111 | fi |
| 4112 | ] |
| 4113 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4114 | AC_SUBST([PRIVSEP_PATH]) |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4115 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4116 | AC_ARG_WITH([xauth], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4117 | [ --with-xauth=PATH Specify path to xauth program ], |
| 4118 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4119 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4120 | test "x${withval}" != "xyes"; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4121 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4122 | fi |
| 4123 | ], |
| 4124 | [ |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4125 | TestPath="$PATH" |
| 4126 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" |
| 4127 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" |
| 4128 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" |
| 4129 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4130 | AC_PATH_PROG([xauth_path], [xauth], , [$TestPath]) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 4131 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4132 | xauth_path="/usr/openwin/bin/xauth" |
| 4133 | fi |
| 4134 | ] |
| 4135 | ) |
| 4136 | |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4137 | STRIP_OPT=-s |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4138 | AC_ARG_ENABLE([strip], |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4139 | [ --disable-strip Disable calling strip(1) on install], |
| 4140 | [ |
| 4141 | if test "x$enableval" = "xno" ; then |
| 4142 | STRIP_OPT= |
| 4143 | fi |
| 4144 | ] |
| 4145 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4146 | AC_SUBST([STRIP_OPT]) |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4147 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4148 | if test -z "$xauth_path" ; then |
| 4149 | XAUTH_PATH="undefined" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4150 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4151 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4152 | AC_DEFINE_UNQUOTED([XAUTH_PATH], ["$xauth_path"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4153 | [Define if xauth is found in your path]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4154 | XAUTH_PATH=$xauth_path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4155 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4156 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4157 | |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4158 | dnl # --with-maildir=/path/to/mail gets top priority. |
| 4159 | dnl # if maildir is set in the platform case statement above we use that. |
| 4160 | dnl # Otherwise we run a program to get the dir from system headers. |
| 4161 | dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL |
| 4162 | dnl # If we find _PATH_MAILDIR we do nothing because that is what |
| 4163 | dnl # session.c expects anyway. Otherwise we set to the value found |
| 4164 | dnl # stripping any trailing slash. If for some strage reason our program |
| 4165 | dnl # does not find what it needs, we default to /var/spool/mail. |
| 4166 | # Check for mail directory |
| 4167 | AC_ARG_WITH([maildir], |
| 4168 | [ --with-maildir=/path/to/mail Specify your system mail directory], |
| 4169 | [ |
| 4170 | if test "X$withval" != X && test "x$withval" != xno && \ |
| 4171 | test "x${withval}" != xyes; then |
| 4172 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"], |
| 4173 | [Set this to your mail directory if you do not have _PATH_MAILDIR]) |
| 4174 | fi |
| 4175 | ],[ |
| 4176 | if test "X$maildir" != "X"; then |
| 4177 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4178 | else |
| 4179 | AC_MSG_CHECKING([Discovering system mail directory]) |
| 4180 | AC_RUN_IFELSE( |
| 4181 | [AC_LANG_PROGRAM([[ |
| 4182 | #include <stdio.h> |
| 4183 | #include <string.h> |
| 4184 | #ifdef HAVE_PATHS_H |
| 4185 | #include <paths.h> |
| 4186 | #endif |
| 4187 | #ifdef HAVE_MAILLOCK_H |
| 4188 | #include <maillock.h> |
| 4189 | #endif |
| 4190 | #define DATA "conftest.maildir" |
| 4191 | ]], [[ |
| 4192 | FILE *fd; |
| 4193 | int rc; |
| 4194 | |
| 4195 | fd = fopen(DATA,"w"); |
| 4196 | if(fd == NULL) |
| 4197 | exit(1); |
| 4198 | |
| 4199 | #if defined (_PATH_MAILDIR) |
| 4200 | if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0) |
| 4201 | exit(1); |
| 4202 | #elif defined (MAILDIR) |
| 4203 | if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0) |
| 4204 | exit(1); |
| 4205 | #elif defined (_PATH_MAIL) |
| 4206 | if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0) |
| 4207 | exit(1); |
| 4208 | #else |
| 4209 | exit (2); |
| 4210 | #endif |
| 4211 | |
| 4212 | exit(0); |
| 4213 | ]])], |
| 4214 | [ |
| 4215 | maildir_what=`awk -F: '{print $1}' conftest.maildir` |
| 4216 | maildir=`awk -F: '{print $2}' conftest.maildir \ |
| 4217 | | sed 's|/$||'` |
| 4218 | AC_MSG_RESULT([Using: $maildir from $maildir_what]) |
| 4219 | if test "x$maildir_what" != "x_PATH_MAILDIR"; then |
| 4220 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4221 | fi |
| 4222 | ], |
| 4223 | [ |
| 4224 | if test "X$ac_status" = "X2";then |
| 4225 | # our test program didn't find it. Default to /var/spool/mail |
| 4226 | AC_MSG_RESULT([Using: default value of /var/spool/mail]) |
| 4227 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"]) |
| 4228 | else |
| 4229 | AC_MSG_RESULT([*** not found ***]) |
| 4230 | fi |
| 4231 | ], |
| 4232 | [ |
| 4233 | AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail]) |
| 4234 | ] |
| 4235 | ) |
| 4236 | fi |
| 4237 | ] |
| 4238 | ) # maildir |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4239 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4240 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4241 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) |
| 4242 | disable_ptmx_check=yes |
| 4243 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4244 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4245 | if test "x$disable_ptmx_check" != "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4246 | AC_CHECK_FILE(["/dev/ptmx"], |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4247 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4248 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTMX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4249 | [Define if you have /dev/ptmx]) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4250 | have_dev_ptmx=1 |
| 4251 | ] |
| 4252 | ) |
| 4253 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4254 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4255 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4256 | if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4257 | AC_CHECK_FILE(["/dev/ptc"], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4258 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4259 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTS_AND_PTC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4260 | [Define if you have /dev/ptc]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4261 | have_dev_ptc=1 |
| 4262 | ] |
| 4263 | ) |
| 4264 | else |
| 4265 | AC_MSG_WARN([cross compiling: Disabling /dev/ptc test]) |
| 4266 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 4267 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4268 | # Options from here on. Some of these are preset by platform above |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4269 | AC_ARG_WITH([mantype], |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4270 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4271 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4272 | case "$withval" in |
| 4273 | man|cat|doc) |
| 4274 | MANTYPE=$withval |
| 4275 | ;; |
| 4276 | *) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4277 | AC_MSG_ERROR([invalid man type: $withval]) |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4278 | ;; |
| 4279 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4280 | ] |
| 4281 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4282 | if test -z "$MANTYPE"; then |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4283 | TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4284 | AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4285 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4286 | MANTYPE=doc |
| 4287 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4288 | MANTYPE=man |
| 4289 | else |
| 4290 | MANTYPE=cat |
| 4291 | fi |
| 4292 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4293 | AC_SUBST([MANTYPE]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4294 | if test "$MANTYPE" = "doc"; then |
| 4295 | mansubdir=man; |
| 4296 | else |
| 4297 | mansubdir=$MANTYPE; |
| 4298 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4299 | AC_SUBST([mansubdir]) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4300 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4301 | # Check whether to enable MD5 passwords |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4302 | MD5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4303 | AC_ARG_WITH([md5-passwords], |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4304 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4305 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 4306 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4307 | AC_DEFINE([HAVE_MD5_PASSWORDS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4308 | [Define if you want to allow MD5 passwords]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4309 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4310 | fi |
| 4311 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4312 | ) |
| 4313 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4314 | # Whether to disable shadow password support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4315 | AC_ARG_WITH([shadow], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4316 | [ --without-shadow Disable shadow password support], |
| 4317 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4318 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4319 | AC_DEFINE([DISABLE_SHADOW]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4320 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4321 | fi |
| 4322 | ] |
| 4323 | ) |
| 4324 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4325 | if test -z "$disable_shadow" ; then |
| 4326 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4327 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4328 | #include <sys/types.h> |
| 4329 | #include <shadow.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4330 | struct spwd sp; |
| 4331 | ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])], |
| 4332 | [ sp_expire_available=yes ], [ |
| 4333 | ]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4334 | |
| 4335 | if test "x$sp_expire_available" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4336 | AC_MSG_RESULT([yes]) |
| 4337 | AC_DEFINE([HAS_SHADOW_EXPIRE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4338 | [Define if you want to use shadow password expire field]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4339 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4340 | AC_MSG_RESULT([no]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4341 | fi |
| 4342 | fi |
| 4343 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4344 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4345 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 4346 | DISPLAY_HACK_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4347 | AC_DEFINE([IPADDR_IN_DISPLAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4348 | [Define if you need to use IP address |
| 4349 | instead of hostname in $DISPLAY]) |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4350 | else |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4351 | DISPLAY_HACK_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4352 | AC_ARG_WITH([ipaddr-display], |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4353 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 4354 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4355 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4356 | AC_DEFINE([IPADDR_IN_DISPLAY]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4357 | DISPLAY_HACK_MSG="yes" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4358 | fi |
| 4359 | ] |
| 4360 | ) |
| 4361 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4362 | |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4363 | # check for /etc/default/login and use it if present. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4364 | AC_ARG_ENABLE([etc-default-login], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 4365 | [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4366 | [ if test "x$enableval" = "xno"; then |
| 4367 | AC_MSG_NOTICE([/etc/default/login handling disabled]) |
| 4368 | etc_default_login=no |
| 4369 | else |
| 4370 | etc_default_login=yes |
| 4371 | fi ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4372 | [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; |
| 4373 | then |
| 4374 | AC_MSG_WARN([cross compiling: not checking /etc/default/login]) |
| 4375 | etc_default_login=no |
| 4376 | else |
| 4377 | etc_default_login=yes |
| 4378 | fi ] |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4379 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4380 | |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4381 | if test "x$etc_default_login" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4382 | AC_CHECK_FILE(["/etc/default/login"], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4383 | [ external_path_file=/etc/default/login ]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4384 | if test "x$external_path_file" = "x/etc/default/login"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4385 | AC_DEFINE([HAVE_ETC_DEFAULT_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4386 | [Define if your system has /etc/default/login]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4387 | fi |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4388 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4389 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4390 | 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] | 4391 | if test $ac_cv_func_login_getcapbool = "yes" && \ |
| 4392 | test $ac_cv_header_login_cap_h = "yes" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4393 | external_path_file=/etc/login.conf |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4394 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4395 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4396 | # Whether to mess with the default path |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4397 | SERVER_PATH_MSG="(default)" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4398 | AC_ARG_WITH([default-path], |
Damien Miller | f71d2a5 | 2002-05-13 15:14:08 +1000 | [diff] [blame] | 4399 | [ --with-default-path= Specify default \$PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4400 | [ |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4401 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4402 | AC_MSG_WARN([ |
| 4403 | --with-default-path=PATH has no effect on this system. |
| 4404 | Edit /etc/login.conf instead.]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4405 | elif test "x$withval" != "xno" ; then |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4406 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4407 | AC_MSG_WARN([ |
| 4408 | --with-default-path=PATH will only be used if PATH is not defined in |
| 4409 | $external_path_file .]) |
| 4410 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4411 | user_path="$withval" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4412 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4413 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4414 | ], |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4415 | [ if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 4416 | 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] | 4417 | else |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4418 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4419 | AC_MSG_WARN([ |
| 4420 | If PATH is defined in $external_path_file, ensure the path to scp is included, |
| 4421 | otherwise scp will not work.]) |
| 4422 | fi |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4423 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4424 | [AC_LANG_PROGRAM([[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4425 | /* find out what STDPATH is */ |
| 4426 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4427 | #ifdef HAVE_PATHS_H |
| 4428 | # include <paths.h> |
| 4429 | #endif |
| 4430 | #ifndef _PATH_STDPATH |
Tim Rice | 1c9e688 | 2002-11-22 13:29:01 -0800 | [diff] [blame] | 4431 | # ifdef _PATH_USERPATH /* Irix */ |
| 4432 | # define _PATH_STDPATH _PATH_USERPATH |
| 4433 | # else |
| 4434 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 4435 | # endif |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4436 | #endif |
| 4437 | #include <sys/types.h> |
| 4438 | #include <sys/stat.h> |
| 4439 | #include <fcntl.h> |
| 4440 | #define DATA "conftest.stdpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4441 | ]], [[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4442 | FILE *fd; |
| 4443 | int rc; |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4444 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4445 | fd = fopen(DATA,"w"); |
| 4446 | if(fd == NULL) |
| 4447 | exit(1); |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4448 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4449 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 4450 | exit(1); |
| 4451 | |
| 4452 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4453 | ]])], |
| 4454 | [ user_path=`cat conftest.stdpath` ], |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4455 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 4456 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 4457 | ) |
| 4458 | # make sure $bindir is in USER_PATH so scp will work |
Damien Miller | 77eab7b | 2012-07-06 11:49:28 +1000 | [diff] [blame] | 4459 | t_bindir="${bindir}" |
| 4460 | while echo "${t_bindir}" | egrep '\$\{|NONE/' >/dev/null 2>&1; do |
| 4461 | t_bindir=`eval echo ${t_bindir}` |
| 4462 | case $t_bindir in |
| 4463 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 4464 | esac |
| 4465 | case $t_bindir in |
| 4466 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 4467 | esac |
| 4468 | done |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4469 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 4470 | if test $? -ne 0 ; then |
| 4471 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 4472 | if test $? -ne 0 ; then |
| 4473 | user_path=$user_path:$t_bindir |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4474 | 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] | 4475 | fi |
| 4476 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4477 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4478 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4479 | if test "x$external_path_file" != "x/etc/login.conf" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4480 | AC_DEFINE_UNQUOTED([USER_PATH], ["$user_path"], [Specify default $PATH]) |
| 4481 | AC_SUBST([user_path]) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4482 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4483 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4484 | # Set superuser path separately to user path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4485 | AC_ARG_WITH([superuser-path], |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4486 | [ --with-superuser-path= Specify different path for super-user], |
| 4487 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4488 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4489 | test "x${withval}" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4490 | AC_DEFINE_UNQUOTED([SUPERUSER_PATH], ["$withval"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4491 | [Define if you want a different $PATH |
| 4492 | for the superuser]) |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4493 | superuser_path=$withval |
| 4494 | fi |
| 4495 | ] |
| 4496 | ) |
| 4497 | |
| 4498 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4499 | 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] | 4500 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4501 | AC_ARG_WITH(4in6, |
| 4502 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 4503 | [ |
| 4504 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4505 | AC_MSG_RESULT([yes]) |
| 4506 | AC_DEFINE([IPV4_IN_IPV6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4507 | [Detect IPv4 in IPv6 mapped addresses |
| 4508 | and treat as IPv4]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4509 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4510 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4511 | AC_MSG_RESULT([no]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4512 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4513 | ], [ |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4514 | if test "x$inet6_default_4in6" = "xyes"; then |
| 4515 | AC_MSG_RESULT([yes (default)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4516 | AC_DEFINE([IPV4_IN_IPV6]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4517 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4518 | else |
| 4519 | AC_MSG_RESULT([no (default)]) |
| 4520 | fi |
| 4521 | ] |
| 4522 | ) |
| 4523 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4524 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4525 | BSD_AUTH_MSG=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4526 | AC_ARG_WITH([bsd-auth], |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4527 | [ --with-bsd-auth Enable BSD auth support], |
| 4528 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4529 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4530 | AC_DEFINE([BSD_AUTH], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4531 | [Define if you have BSD auth support]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4532 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4533 | fi |
| 4534 | ] |
| 4535 | ) |
| 4536 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4537 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 4538 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4539 | # make sure the directory exists |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4540 | if test ! -d $piddir ; then |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4541 | piddir=`eval echo ${sysconfdir}` |
| 4542 | case $piddir in |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4543 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4544 | esac |
| 4545 | fi |
| 4546 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4547 | AC_ARG_WITH([pid-dir], |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4548 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 4549 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4550 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4551 | test "x${withval}" != "xyes"; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4552 | piddir=$withval |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4553 | if test ! -d $piddir ; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4554 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 4555 | fi |
| 4556 | fi |
| 4557 | ] |
| 4558 | ) |
| 4559 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4560 | AC_DEFINE_UNQUOTED([_PATH_SSH_PIDDIR], ["$piddir"], |
| 4561 | [Specify location of ssh.pid]) |
| 4562 | AC_SUBST([piddir]) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 4563 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4564 | dnl allow user to disable some login recording features |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4565 | AC_ARG_ENABLE([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4566 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4567 | [ |
| 4568 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4569 | AC_DEFINE([DISABLE_LASTLOG]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4570 | fi |
| 4571 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4572 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4573 | AC_ARG_ENABLE([utmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4574 | [ --disable-utmp disable use of utmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4575 | [ |
| 4576 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4577 | AC_DEFINE([DISABLE_UTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4578 | fi |
| 4579 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4580 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4581 | AC_ARG_ENABLE([utmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4582 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4583 | [ |
| 4584 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4585 | AC_DEFINE([DISABLE_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4586 | [Define if you don't want to use utmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4587 | fi |
| 4588 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4589 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4590 | AC_ARG_ENABLE([wtmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4591 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4592 | [ |
| 4593 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4594 | AC_DEFINE([DISABLE_WTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4595 | fi |
| 4596 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4597 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4598 | AC_ARG_ENABLE([wtmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4599 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4600 | [ |
| 4601 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4602 | AC_DEFINE([DISABLE_WTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4603 | [Define if you don't want to use wtmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4604 | fi |
| 4605 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4606 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4607 | AC_ARG_ENABLE([libutil], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4608 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4609 | [ |
| 4610 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4611 | AC_DEFINE([DISABLE_LOGIN]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4612 | fi |
| 4613 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4614 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4615 | AC_ARG_ENABLE([pututline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4616 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4617 | [ |
| 4618 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4619 | AC_DEFINE([DISABLE_PUTUTLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4620 | [Define if you don't want to use pututline() |
| 4621 | etc. to write [uw]tmp]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4622 | fi |
| 4623 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4624 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4625 | AC_ARG_ENABLE([pututxline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4626 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4627 | [ |
| 4628 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4629 | AC_DEFINE([DISABLE_PUTUTXLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4630 | [Define if you don't want to use pututxline() |
| 4631 | etc. to write [uw]tmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4632 | fi |
| 4633 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4634 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4635 | AC_ARG_WITH([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4636 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4637 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4638 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4639 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4640 | elif test -n "$withval" && test "x${withval}" != "xyes"; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4641 | conf_lastlog_location=$withval |
| 4642 | fi |
| 4643 | ] |
| 4644 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4645 | |
| 4646 | dnl lastlog, [uw]tmpx? detection |
| 4647 | dnl NOTE: set the paths in the platform section to avoid the |
| 4648 | dnl need for command-line parameters |
| 4649 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 4650 | |
| 4651 | dnl lastlog detection |
| 4652 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 4653 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4654 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4655 | #include <sys/types.h> |
| 4656 | #include <utmp.h> |
| 4657 | #ifdef HAVE_LASTLOG_H |
| 4658 | # include <lastlog.h> |
| 4659 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4660 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4661 | # include <paths.h> |
| 4662 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 4663 | #ifdef HAVE_LOGIN_H |
| 4664 | # include <login.h> |
| 4665 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4666 | ]], [[ char *lastlog = LASTLOG_FILE; ]])], |
| 4667 | [ AC_MSG_RESULT([yes]) ], |
| 4668 | [ |
| 4669 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4670 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4671 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4672 | #include <sys/types.h> |
| 4673 | #include <utmp.h> |
| 4674 | #ifdef HAVE_LASTLOG_H |
| 4675 | # include <lastlog.h> |
| 4676 | #endif |
| 4677 | #ifdef HAVE_PATHS_H |
| 4678 | # include <paths.h> |
| 4679 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4680 | ]], [[ char *lastlog = _PATH_LASTLOG; ]])], |
| 4681 | [ AC_MSG_RESULT([yes]) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4682 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4683 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4684 | system_lastlog_path=no |
| 4685 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4686 | ]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4687 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4688 | if test -z "$conf_lastlog_location"; then |
| 4689 | if test x"$system_lastlog_path" = x"no" ; then |
| 4690 | 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] | 4691 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4692 | conf_lastlog_location=$f |
| 4693 | fi |
| 4694 | done |
| 4695 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 4696 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 4697 | 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] | 4698 | fi |
| 4699 | fi |
| 4700 | fi |
| 4701 | |
| 4702 | if test -n "$conf_lastlog_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4703 | AC_DEFINE_UNQUOTED([CONF_LASTLOG_FILE], ["$conf_lastlog_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4704 | [Define if you want to specify the path to your lastlog file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4705 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4706 | |
| 4707 | dnl utmp detection |
| 4708 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4709 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4710 | #include <sys/types.h> |
| 4711 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4712 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4713 | # include <paths.h> |
| 4714 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4715 | ]], [[ char *utmp = UTMP_FILE; ]])], |
| 4716 | [ AC_MSG_RESULT([yes]) ], |
| 4717 | [ AC_MSG_RESULT([no]) |
| 4718 | system_utmp_path=no |
| 4719 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4720 | if test -z "$conf_utmp_location"; then |
| 4721 | if test x"$system_utmp_path" = x"no" ; then |
| 4722 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 4723 | if test -f $f ; then |
| 4724 | conf_utmp_location=$f |
| 4725 | fi |
| 4726 | done |
| 4727 | if test -z "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4728 | AC_DEFINE([DISABLE_UTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4729 | fi |
| 4730 | fi |
| 4731 | fi |
| 4732 | if test -n "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4733 | AC_DEFINE_UNQUOTED([CONF_UTMP_FILE], ["$conf_utmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4734 | [Define if you want to specify the path to your utmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4735 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4736 | |
| 4737 | dnl wtmp detection |
| 4738 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4739 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4740 | #include <sys/types.h> |
| 4741 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4742 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4743 | # include <paths.h> |
| 4744 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4745 | ]], [[ char *wtmp = WTMP_FILE; ]])], |
| 4746 | [ AC_MSG_RESULT([yes]) ], |
| 4747 | [ AC_MSG_RESULT([no]) |
| 4748 | system_wtmp_path=no |
| 4749 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4750 | if test -z "$conf_wtmp_location"; then |
| 4751 | if test x"$system_wtmp_path" = x"no" ; then |
| 4752 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 4753 | if test -f $f ; then |
| 4754 | conf_wtmp_location=$f |
| 4755 | fi |
| 4756 | done |
| 4757 | if test -z "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4758 | AC_DEFINE([DISABLE_WTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4759 | fi |
| 4760 | fi |
| 4761 | fi |
| 4762 | if test -n "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4763 | AC_DEFINE_UNQUOTED([CONF_WTMP_FILE], ["$conf_wtmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4764 | [Define if you want to specify the path to your wtmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4765 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4766 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4767 | dnl wtmpx detection |
| 4768 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4769 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4770 | #include <sys/types.h> |
| 4771 | #include <utmp.h> |
| 4772 | #ifdef HAVE_UTMPX_H |
| 4773 | #include <utmpx.h> |
| 4774 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4775 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4776 | # include <paths.h> |
| 4777 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4778 | ]], [[ char *wtmpx = WTMPX_FILE; ]])], |
| 4779 | [ AC_MSG_RESULT([yes]) ], |
| 4780 | [ AC_MSG_RESULT([no]) |
| 4781 | system_wtmpx_path=no |
| 4782 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4783 | if test -z "$conf_wtmpx_location"; then |
| 4784 | if test x"$system_wtmpx_path" = x"no" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4785 | AC_DEFINE([DISABLE_WTMPX]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4786 | fi |
| 4787 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4788 | AC_DEFINE_UNQUOTED([CONF_WTMPX_FILE], ["$conf_wtmpx_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4789 | [Define if you want to specify the path to your wtmpx file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4790 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4791 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 4792 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 4793 | if test ! -z "$blibpath" ; then |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 4794 | LDFLAGS="$LDFLAGS $blibflags$blibpath" |
| 4795 | AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 4796 | fi |
| 4797 | |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4798 | AC_CHECK_MEMBER([struct lastlog.ll_line], [], [ |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 4799 | if test x$SKIP_DISABLE_LASTLOG_DEFINE != "xyes" ; then |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4800 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 4801 | fi |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4802 | ], [ |
| 4803 | #ifdef HAVE_SYS_TYPES_H |
| 4804 | #include <sys/types.h> |
| 4805 | #endif |
| 4806 | #ifdef HAVE_UTMP_H |
| 4807 | #include <utmp.h> |
| 4808 | #endif |
| 4809 | #ifdef HAVE_UTMPX_H |
| 4810 | #include <utmpx.h> |
| 4811 | #endif |
| 4812 | #ifdef HAVE_LASTLOG_H |
| 4813 | #include <lastlog.h> |
| 4814 | #endif |
| 4815 | ]) |
| 4816 | |
| 4817 | AC_CHECK_MEMBER([struct utmp.ut_line], [], [ |
| 4818 | AC_DEFINE([DISABLE_UTMP]) |
| 4819 | AC_DEFINE([DISABLE_WTMP]) |
| 4820 | ], [ |
| 4821 | #ifdef HAVE_SYS_TYPES_H |
| 4822 | #include <sys/types.h> |
| 4823 | #endif |
| 4824 | #ifdef HAVE_UTMP_H |
| 4825 | #include <utmp.h> |
| 4826 | #endif |
| 4827 | #ifdef HAVE_UTMPX_H |
| 4828 | #include <utmpx.h> |
| 4829 | #endif |
| 4830 | #ifdef HAVE_LASTLOG_H |
| 4831 | #include <lastlog.h> |
| 4832 | #endif |
| 4833 | ]) |
| 4834 | |
Darren Tucker | 7da23cb | 2005-08-03 00:20:15 +1000 | [diff] [blame] | 4835 | dnl Adding -Werror to CFLAGS early prevents configure tests from running. |
| 4836 | dnl Add now. |
| 4837 | CFLAGS="$CFLAGS $werror_flags" |
| 4838 | |
Darren Tucker | 627337d | 2010-04-10 22:58:01 +1000 | [diff] [blame] | 4839 | if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then |
| 4840 | TEST_SSH_IPV6=no |
| 4841 | else |
| 4842 | TEST_SSH_IPV6=yes |
| 4843 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4844 | AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no]) |
| 4845 | AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 4846 | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) |
Darren Tucker | 6d8bd57 | 2013-06-11 11:26:10 +1000 | [diff] [blame] | 4847 | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) |
Darren Tucker | 5d37690 | 2008-06-11 04:15:05 +1000 | [diff] [blame] | 4848 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 4849 | AC_EXEEXT |
Damien Miller | 223897a | 2006-09-12 21:54:10 +1000 | [diff] [blame] | 4850 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
| 4851 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 4852 | survey.sh]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 4853 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 4854 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4855 | # Print summary of options |
| 4856 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4857 | # Someone please show me a better way :) |
| 4858 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 4859 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 4860 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 4861 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 4862 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4863 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4864 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4865 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 4866 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 4867 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4868 | |
| 4869 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 4870 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4871 | echo " User binaries: $B" |
| 4872 | echo " System binaries: $C" |
| 4873 | echo " Configuration files: $D" |
| 4874 | echo " Askpass program: $E" |
| 4875 | echo " Manual pages: $F" |
| 4876 | echo " PID file: $G" |
| 4877 | echo " Privilege separation chroot path: $H" |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4878 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 4879 | echo " At runtime, sshd will use the path defined in $external_path_file" |
| 4880 | 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] | 4881 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4882 | echo " sshd default user PATH: $I" |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4883 | if test ! -z "$external_path_file"; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4884 | echo " (If PATH is set in $external_path_file it will be used instead. If" |
| 4885 | echo " used, ensure the path to scp is present, otherwise scp will not work.)" |
| 4886 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4887 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4888 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4889 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4890 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4891 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4892 | echo " PAM support: $PAM_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 4893 | echo " OSF SIA support: $SIA_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4894 | echo " KerberosV support: $KRB5_MSG" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4895 | echo " SELinux support: $SELINUX_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4896 | echo " Smartcard support: $SCARD_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4897 | echo " S/KEY support: $SKEY_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4898 | echo " MD5 password support: $MD5_MSG" |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 4899 | echo " libedit support: $LIBEDIT_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 4900 | echo " Solaris process contract support: $SPC_MSG" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 4901 | echo " Solaris project support: $SP_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 4902 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4903 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 4904 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 4905 | echo " Random number source: $RAND_MSG" |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 4906 | echo " Privsep sandbox style: $SANDBOX_STYLE" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4907 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4908 | echo "" |
| 4909 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 4910 | echo " Host: ${host}" |
| 4911 | echo " Compiler: ${CC}" |
| 4912 | echo " Compiler flags: ${CFLAGS}" |
| 4913 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 4914 | echo " Linker flags: ${LDFLAGS}" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4915 | echo " Libraries: ${LIBS}" |
| 4916 | if test ! -z "${SSHDLIBS}"; then |
| 4917 | echo " +for sshd: ${SSHDLIBS}" |
| 4918 | fi |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 4919 | if test ! -z "${SSHLIBS}"; then |
| 4920 | echo " +for ssh: ${SSHLIBS}" |
| 4921 | fi |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4922 | |
| 4923 | echo "" |
| 4924 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 4925 | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then |
Darren Tucker | cf59d31 | 2004-08-29 21:18:09 +1000 | [diff] [blame] | 4926 | echo "SVR4 style packages are supported with \"make package\"" |
| 4927 | echo "" |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 4928 | fi |
| 4929 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 4930 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4931 | echo "PAM is enabled. You may need to install a PAM control file " |
| 4932 | echo "for sshd, otherwise password authentication may fail. " |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4933 | echo "Example PAM control files can be found in the contrib/ " |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4934 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 4935 | echo "" |
| 4936 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 4937 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 4938 | if test ! -z "$NO_PEERCHECK" ; then |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 4939 | echo "WARNING: the operating system that you are using does not" |
| 4940 | echo "appear to support getpeereid(), getpeerucred() or the" |
| 4941 | echo "SO_PEERCRED getsockopt() option. These facilities are used to" |
| 4942 | echo "enforce security checks to prevent unauthorised connections to" |
| 4943 | echo "ssh-agent. Their absence increases the risk that a malicious" |
| 4944 | echo "user can connect to your agent." |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 4945 | echo "" |
| 4946 | fi |
| 4947 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 4948 | if test "$AUDIT_MODULE" = "bsm" ; then |
| 4949 | echo "WARNING: BSM audit support is currently considered EXPERIMENTAL." |
| 4950 | echo "See the Solaris section in README.platform for details." |
| 4951 | fi |