Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 1 | # $Id: configure.ac,v 1.521 2013/04/23 04:25:53 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 | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 18 | AC_REVISION($Revision: 1.521 $) |
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 | ]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 123 | use_stack_protector=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 124 | AC_ARG_WITH([stackprotect], |
Damien Miller | da3155e | 2008-03-27 12:30:18 +1100 | [diff] [blame] | 125 | [ --without-stackprotect Don't use compiler's stack protection], [ |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 126 | if test "x$withval" = "xno"; then |
| 127 | use_stack_protector=0 |
| 128 | fi ]) |
| 129 | |
Damien Miller | 134d02a | 2011-01-12 16:00:37 +1100 | [diff] [blame] | 130 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 131 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 132 | OSSH_CHECK_CFLAG_COMPILE([-Wall]) |
| 133 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) |
| 134 | OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) |
| 135 | OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) |
| 136 | OSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) |
| 137 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) |
| 138 | OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) |
| 139 | OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) |
Darren Tucker | ce1c957 | 2013-04-18 21:36:19 +1000 | [diff] [blame] | 140 | OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) |
Darren Tucker | 4a725ef | 2011-11-21 16:38:48 +1100 | [diff] [blame] | 141 | OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 142 | AC_MSG_CHECKING([gcc version]) |
Darren Tucker | 3f9545e | 2005-11-12 15:20:52 +1100 | [diff] [blame] | 143 | GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 144 | case $GCC_VER in |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 145 | 1.*) no_attrib_nonnull=1 ;; |
| 146 | 2.8* | 2.9*) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 147 | no_attrib_nonnull=1 |
| 148 | ;; |
| 149 | 2.*) no_attrib_nonnull=1 ;; |
Darren Tucker | f032435 | 2005-11-10 21:30:36 +1100 | [diff] [blame] | 150 | *) ;; |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 151 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 152 | AC_MSG_RESULT([$GCC_VER]) |
Damien Miller | de3cb0a | 2005-05-26 20:48:25 +1000 | [diff] [blame] | 153 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 154 | AC_MSG_CHECKING([if $CC accepts -fno-builtin-memset]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 155 | saved_CFLAGS="$CFLAGS" |
| 156 | CFLAGS="$CFLAGS -fno-builtin-memset" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 157 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> ]], |
| 158 | [[ char b[10]; memset(b, 0, sizeof(b)); ]])], |
| 159 | [ AC_MSG_RESULT([yes]) ], |
| 160 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 161 | CFLAGS="$saved_CFLAGS" ] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 162 | ) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 163 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 164 | # -fstack-protector-all doesn't always work for some GCC versions |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 165 | # 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] | 166 | # 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] | 167 | if test "x$use_stack_protector" = "x1"; then |
| 168 | for t in -fstack-protector-all -fstack-protector; do |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 169 | AC_MSG_CHECKING([if $CC supports $t]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 170 | saved_CFLAGS="$CFLAGS" |
| 171 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 172 | CFLAGS="$CFLAGS $t -Werror" |
| 173 | LDFLAGS="$LDFLAGS $t -Werror" |
| 174 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 175 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 176 | [[ |
| 177 | char x[256]; |
| 178 | snprintf(x, sizeof(x), "XXX"); |
| 179 | ]])], |
| 180 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 181 | CFLAGS="$saved_CFLAGS $t" |
| 182 | LDFLAGS="$saved_LDFLAGS $t" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 183 | AC_MSG_CHECKING([if $t works]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 184 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 185 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 186 | [[ |
| 187 | char x[256]; |
| 188 | snprintf(x, sizeof(x), "XXX"); |
| 189 | ]])], |
| 190 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 191 | break ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 192 | [ AC_MSG_RESULT([no]) ], |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 193 | [ AC_MSG_WARN([cross compiling: cannot test]) |
| 194 | break ] |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 195 | ) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 196 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 197 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 198 | ) |
| 199 | CFLAGS="$saved_CFLAGS" |
| 200 | LDFLAGS="$saved_LDFLAGS" |
| 201 | done |
| 202 | fi |
Darren Tucker | 319b3d9 | 2007-12-02 21:02:22 +1100 | [diff] [blame] | 203 | |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 204 | if test -z "$have_llong_max"; then |
| 205 | # retry LLONG_MAX with -std=gnu99, needed on some Linuxes |
| 206 | unset ac_cv_have_decl_LLONG_MAX |
| 207 | saved_CFLAGS="$CFLAGS" |
| 208 | CFLAGS="$CFLAGS -std=gnu99" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 209 | AC_CHECK_DECL([LLONG_MAX], |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 210 | [have_llong_max=1], |
| 211 | [CFLAGS="$saved_CFLAGS"], |
| 212 | [#include <limits.h>] |
| 213 | ) |
| 214 | fi |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 215 | fi |
| 216 | |
Darren Tucker | 951b53b | 2013-02-08 11:50:09 +1100 | [diff] [blame] | 217 | AC_MSG_CHECKING([if compiler allows __attribute__ on return types]) |
| 218 | AC_COMPILE_IFELSE( |
| 219 | [AC_LANG_PROGRAM([[ |
| 220 | #include <stdlib.h> |
| 221 | __attribute__((__unused__)) static void foo(void){return;}]], |
| 222 | [[ exit(0); ]])], |
| 223 | [ AC_MSG_RESULT([yes]) ], |
| 224 | [ AC_MSG_RESULT([no]) |
| 225 | AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1, |
| 226 | [compiler does not accept __attribute__ on return types]) ] |
| 227 | ) |
| 228 | |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 229 | if test "x$no_attrib_nonnull" != "x1" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 230 | AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull]) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 231 | fi |
| 232 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 233 | AC_ARG_WITH([rpath], |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 234 | [ --without-rpath Disable auto-added -R linker paths], |
| 235 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 236 | if test "x$withval" = "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 237 | need_dash_r="" |
| 238 | fi |
| 239 | if test "x$withval" = "xyes" ; then |
| 240 | need_dash_r=1 |
| 241 | fi |
| 242 | ] |
| 243 | ) |
| 244 | |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 245 | # Allow user to specify flags |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 246 | AC_ARG_WITH([cflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 247 | [ --with-cflags Specify additional flags to pass to compiler], |
| 248 | [ |
| 249 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 250 | test "x${withval}" != "xyes"; then |
| 251 | CFLAGS="$CFLAGS $withval" |
| 252 | fi |
| 253 | ] |
| 254 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 255 | AC_ARG_WITH([cppflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 256 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 257 | [ |
| 258 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 259 | test "x${withval}" != "xyes"; then |
| 260 | CPPFLAGS="$CPPFLAGS $withval" |
| 261 | fi |
| 262 | ] |
| 263 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 264 | AC_ARG_WITH([ldflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 265 | [ --with-ldflags Specify additional flags to pass to linker], |
| 266 | [ |
| 267 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 268 | test "x${withval}" != "xyes"; then |
| 269 | LDFLAGS="$LDFLAGS $withval" |
| 270 | fi |
| 271 | ] |
| 272 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 273 | AC_ARG_WITH([libs], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 274 | [ --with-libs Specify additional libraries to link with], |
| 275 | [ |
| 276 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 277 | test "x${withval}" != "xyes"; then |
| 278 | LIBS="$LIBS $withval" |
| 279 | fi |
| 280 | ] |
| 281 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 282 | AC_ARG_WITH([Werror], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 283 | [ --with-Werror Build main code with -Werror], |
| 284 | [ |
| 285 | if test -n "$withval" && test "x$withval" != "xno"; then |
| 286 | werror_flags="-Werror" |
| 287 | if test "x${withval}" != "xyes"; then |
| 288 | werror_flags="$withval" |
| 289 | fi |
| 290 | fi |
| 291 | ] |
| 292 | ) |
| 293 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 294 | AC_CHECK_HEADERS([ \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 295 | bstring.h \ |
| 296 | crypt.h \ |
| 297 | crypto/sha2.h \ |
| 298 | dirent.h \ |
| 299 | endian.h \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 300 | elf.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 301 | features.h \ |
| 302 | fcntl.h \ |
| 303 | floatingpoint.h \ |
| 304 | getopt.h \ |
| 305 | glob.h \ |
| 306 | ia.h \ |
| 307 | iaf.h \ |
| 308 | limits.h \ |
| 309 | login.h \ |
| 310 | maillock.h \ |
| 311 | ndir.h \ |
| 312 | net/if_tun.h \ |
| 313 | netdb.h \ |
| 314 | netgroup.h \ |
| 315 | pam/pam_appl.h \ |
| 316 | paths.h \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 317 | poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 318 | pty.h \ |
| 319 | readpassphrase.h \ |
| 320 | rpc/types.h \ |
| 321 | security/pam_appl.h \ |
| 322 | sha2.h \ |
| 323 | shadow.h \ |
| 324 | stddef.h \ |
| 325 | stdint.h \ |
| 326 | string.h \ |
| 327 | strings.h \ |
| 328 | sys/audit.h \ |
| 329 | sys/bitypes.h \ |
| 330 | sys/bsdtty.h \ |
| 331 | sys/cdefs.h \ |
| 332 | sys/dir.h \ |
| 333 | sys/mman.h \ |
| 334 | sys/ndir.h \ |
Darren Tucker | 7c92a65 | 2007-09-27 07:00:09 +1000 | [diff] [blame] | 335 | sys/poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 336 | sys/prctl.h \ |
| 337 | sys/pstat.h \ |
| 338 | sys/select.h \ |
| 339 | sys/stat.h \ |
| 340 | sys/stream.h \ |
| 341 | sys/stropts.h \ |
| 342 | sys/strtio.h \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 343 | sys/statvfs.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 344 | sys/sysmacros.h \ |
| 345 | sys/time.h \ |
| 346 | sys/timers.h \ |
| 347 | sys/un.h \ |
| 348 | time.h \ |
| 349 | tmpdir.h \ |
| 350 | ttyent.h \ |
Tim Rice | aa8954f | 2007-05-09 15:57:43 -0700 | [diff] [blame] | 351 | ucred.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 352 | unistd.h \ |
| 353 | usersec.h \ |
| 354 | util.h \ |
| 355 | utime.h \ |
| 356 | utmp.h \ |
| 357 | utmpx.h \ |
| 358 | vis.h \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 359 | ]) |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 360 | |
| 361 | # lastlog.h requires sys/time.h to be included first on Solaris |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 362 | AC_CHECK_HEADERS([lastlog.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 363 | #ifdef HAVE_SYS_TIME_H |
| 364 | # include <sys/time.h> |
| 365 | #endif |
| 366 | ]) |
| 367 | |
| 368 | # 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] | 369 | AC_CHECK_HEADERS([sys/ptms.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 370 | #ifdef HAVE_SYS_STREAM_H |
| 371 | # include <sys/stream.h> |
| 372 | #endif |
| 373 | ]) |
| 374 | |
| 375 | # login_cap.h requires sys/types.h on NetBSD |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 376 | AC_CHECK_HEADERS([login_cap.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 377 | #include <sys/types.h> |
| 378 | ]) |
| 379 | |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 380 | # older BSDs need sys/param.h before sys/mount.h |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 381 | AC_CHECK_HEADERS([sys/mount.h], [], [], [ |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 382 | #include <sys/param.h> |
| 383 | ]) |
| 384 | |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 385 | # Messages for features tested for in target-specific section |
| 386 | SIA_MSG="no" |
| 387 | SPC_MSG="no" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 388 | SP_MSG="no" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 389 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 390 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 391 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 392 | *-*-aix*) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 393 | # Some versions of VAC won't allow macro redefinitions at |
| 394 | # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that |
| 395 | # particularly with older versions of vac or xlc. |
| 396 | # It also throws errors about null macro argments, but these are |
| 397 | # not fatal. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 398 | AC_MSG_CHECKING([if compiler allows macro redefinitions]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 399 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 400 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 401 | #define testmacro foo |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 402 | #define testmacro bar]], |
| 403 | [[ exit(0); ]])], |
| 404 | [ AC_MSG_RESULT([yes]) ], |
| 405 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 406 | CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`" |
| 407 | LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`" |
| 408 | CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 409 | CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 410 | ] |
| 411 | ) |
| 412 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 413 | AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 414 | if (test -z "$blibpath"); then |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 415 | blibpath="/usr/lib:/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 416 | fi |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 417 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | bdc1212 | 2006-07-06 11:56:25 +1000 | [diff] [blame] | 418 | if test "$GCC" = "yes"; then |
| 419 | flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:" |
| 420 | else |
| 421 | flags="-blibpath: -Wl,-blibpath: -Wl,-rpath," |
| 422 | fi |
| 423 | for tryflags in $flags ;do |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 424 | if (test -z "$blibflags"); then |
| 425 | LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 426 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
| 427 | [blibflags=$tryflags], []) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 428 | fi |
| 429 | done |
| 430 | if (test -z "$blibflags"); then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 431 | AC_MSG_RESULT([not found]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 432 | AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log]) |
| 433 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 434 | AC_MSG_RESULT([$blibflags]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 435 | fi |
| 436 | LDFLAGS="$saved_LDFLAGS" |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 437 | dnl Check for authenticate. Might be in libs.a on older AIXes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 438 | AC_CHECK_FUNC([authenticate], [AC_DEFINE([WITH_AIXAUTHENTICATE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 439 | [Define if you want to enable AIX4's authenticate function])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 440 | [AC_CHECK_LIB([s], [authenticate], |
| 441 | [ AC_DEFINE([WITH_AIXAUTHENTICATE]) |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 442 | LIBS="$LIBS -ls" |
| 443 | ]) |
| 444 | ]) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 445 | dnl Check for various auth function declarations in headers. |
Darren Tucker | 04cfbe0 | 2005-02-20 23:27:11 +1100 | [diff] [blame] | 446 | AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, |
Darren Tucker | e66519d | 2005-03-21 22:46:34 +1100 | [diff] [blame] | 447 | passwdexpired, setauthdb], , , [#include <usersec.h>]) |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 448 | 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] | 449 | AC_CHECK_DECLS([loginfailed], |
| 450 | [AC_MSG_CHECKING([if loginfailed takes 4 arguments]) |
| 451 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <usersec.h> ]], |
| 452 | [[ (void)loginfailed("user","host","tty",0); ]])], |
| 453 | [AC_MSG_RESULT([yes]) |
| 454 | AC_DEFINE([AIX_LOGINFAILED_4ARG], [1], |
| 455 | [Define if your AIX loginfailed() function |
| 456 | takes 4 arguments (AIX >= 5.2)])], [AC_MSG_RESULT([no]) |
| 457 | ])], |
| 458 | [], |
| 459 | [#include <usersec.h>] |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 460 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 461 | AC_CHECK_FUNCS([getgrset setauthdb]) |
| 462 | AC_CHECK_DECL([F_CLOSEM], |
| 463 | AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]), |
Darren Tucker | 3083bc2 | 2006-08-17 19:35:49 +1000 | [diff] [blame] | 464 | [], |
| 465 | [ #include <limits.h> |
| 466 | #include <fcntl.h> ] |
| 467 | ) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 468 | check_for_aix_broken_getaddrinfo=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 469 | AC_DEFINE([BROKEN_REALPATH], [1], [Define if you have a broken realpath.]) |
| 470 | AC_DEFINE([SETEUID_BREAKS_SETUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 471 | [Define if your platform breaks doing a seteuid before a setuid]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 472 | AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken]) |
| 473 | AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken]) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 474 | dnl AIX handles lastlog as part of its login message |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 475 | AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog]) |
| 476 | AC_DEFINE([LOGIN_NEEDS_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 477 | [Some systems need a utmpx entry for /bin/login to work]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 478 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 479 | [Define to a Set Process Title type if your system is |
| 480 | supported by bsd-setproctitle.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 481 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Darren Tucker | 91d25a0 | 2005-11-26 22:24:09 +1100 | [diff] [blame] | 482 | [AIX 5.2 and 5.3 (and presumably newer) require this]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 483 | 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] | 484 | 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] | 485 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 486 | *-*-cygwin*) |
Damien Miller | c8936ac | 2003-02-11 10:04:03 +1100 | [diff] [blame] | 487 | check_for_libcrypt_later=1 |
Darren Tucker | 573e387 | 2007-03-02 17:50:03 +1100 | [diff] [blame] | 488 | LIBS="$LIBS /usr/lib/textreadmode.o" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 489 | AC_DEFINE([HAVE_CYGWIN], [1], [Define if you are on Cygwin]) |
| 490 | AC_DEFINE([USE_PIPES], [1], [Use PIPES instead of a socketpair()]) |
| 491 | AC_DEFINE([DISABLE_SHADOW], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 492 | [Define if you want to disable shadow passwords]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 493 | AC_DEFINE([NO_X11_UNIX_SOCKETS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 494 | [Define if X11 doesn't support AF_UNIX sockets on that system]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 495 | AC_DEFINE([NO_IPPORT_RESERVED_CONCEPT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 496 | [Define if the concept of ports only accessible to |
| 497 | superusers isn't known]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 498 | AC_DEFINE([DISABLE_FD_PASSING], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 499 | [Define if your platform needs to skip post auth |
| 500 | file descriptor passing]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 501 | AC_DEFINE([SSH_IOBUFSZ], [65535], [Windows is sensitive to read buffer size]) |
| 502 | AC_DEFINE([FILESYSTEM_NO_BACKSLASH], [1], [File names may not contain backslash characters]) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 503 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 504 | *-*-dgux*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 505 | AC_DEFINE([IP_TOS_IS_BROKEN], [1], |
Tim Rice | a74000e | 2009-03-18 11:25:02 -0700 | [diff] [blame] | 506 | [Define if your system choked on IP TOS setting]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 507 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 508 | AC_DEFINE([BROKEN_SETREUID]) |
| 509 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 510 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 511 | *-*-darwin*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 512 | AC_MSG_CHECKING([if we have working getaddrinfo]) |
| 513 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 514 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
| 515 | exit(0); |
| 516 | else |
| 517 | exit(1); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 518 | } |
| 519 | ]])], |
| 520 | [AC_MSG_RESULT([working])], |
| 521 | [AC_MSG_RESULT([buggy]) |
| 522 | AC_DEFINE([BROKEN_GETADDRINFO], [1], |
| 523 | [getaddrinfo is broken (if present)]) |
| 524 | ], |
| 525 | [AC_MSG_RESULT([assume it is working])]) |
| 526 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 527 | AC_DEFINE([BROKEN_SETREUID]) |
| 528 | AC_DEFINE([BROKEN_SETREGID]) |
| 529 | AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect]) |
| 530 | AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 531 | [Define if your resolver libs need this for getrrsetbyname]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 532 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
| 533 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 534 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 535 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 536 | [Prepend the address family to IP tunnel traffic]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 537 | m4_pattern_allow([AU_IPv]) |
| 538 | AC_CHECK_DECL([AU_IPv4], [], |
| 539 | AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 540 | [#include <bsm/audit.h>] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 541 | AC_DEFINE([LASTLOG_WRITE_PUTUTXLINE], [1], |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 542 | [Define if pututxline updates lastlog too]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 543 | ) |
Damien Miller | c09182f | 2011-06-03 12:11:38 +1000 | [diff] [blame] | 544 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
| 545 | [Define to a Set Process Title type if your system is |
| 546 | supported by bsd-setproctitle.c]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 547 | AC_CHECK_FUNCS([sandbox_init]) |
| 548 | AC_CHECK_HEADERS([sandbox.h]) |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 549 | ;; |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 550 | *-*-dragonfly*) |
| 551 | SSHDLIBS="$SSHDLIBS -lcrypt" |
| 552 | ;; |
Darren Tucker | a83d90f | 2010-03-26 10:27:33 +1100 | [diff] [blame] | 553 | *-*-haiku*) |
| 554 | LIBS="$LIBS -lbsd " |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 555 | AC_CHECK_LIB([network], [socket]) |
| 556 | AC_DEFINE([HAVE_U_INT64_T]) |
Darren Tucker | a83d90f | 2010-03-26 10:27:33 +1100 | [diff] [blame] | 557 | MANTYPE=man |
| 558 | ;; |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 559 | *-*-hpux*) |
| 560 | # 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] | 561 | 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] | 562 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 563 | AC_DEFINE([USE_PIPES]) |
| 564 | AC_DEFINE([LOGIN_NO_ENDOPT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 565 | [Define if your login program cannot handle end of options ("--")]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 566 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
| 567 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 568 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 569 | AC_DEFINE([SPT_TYPE], [SPT_PSTAT]) |
Darren Tucker | aa97d13 | 2013-03-12 11:31:05 +1100 | [diff] [blame] | 570 | AC_DEFINE([PLATFORM_SYS_DIR_UID], 2, [System dirs owned by bin (uid 2)]) |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 571 | maildir="/var/mail" |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 572 | LIBS="$LIBS -lsec" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 573 | AC_CHECK_LIB([xnet], [t_error], , |
| 574 | [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 575 | |
| 576 | # next, we define all of the options specific to major releases |
| 577 | case "$host" in |
| 578 | *-*-hpux10*) |
| 579 | if test -z "$GCC"; then |
| 580 | CFLAGS="$CFLAGS -Ae" |
| 581 | fi |
| 582 | ;; |
| 583 | *-*-hpux11*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 584 | AC_DEFINE([PAM_SUN_CODEBASE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 585 | [Define if you are using Solaris-derived PAM which |
| 586 | passes pam_messages to the conversation function |
| 587 | with an extra level of indirection]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 588 | AC_DEFINE([DISABLE_UTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 589 | [Define if you don't want to use utmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 590 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 591 | check_for_hpux_broken_getaddrinfo=1 |
| 592 | check_for_conflicting_getspnam=1 |
| 593 | ;; |
| 594 | esac |
| 595 | |
| 596 | # lastly, we define options specific to minor releases |
| 597 | case "$host" in |
| 598 | *-*-hpux10.26) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 599 | AC_DEFINE([HAVE_SECUREWARE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 600 | [Define if you have SecureWare-based |
| 601 | protected password database]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 602 | disable_ptmx_check=yes |
| 603 | LIBS="$LIBS -lsecpw" |
| 604 | ;; |
| 605 | esac |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 606 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 607 | *-*-irix5*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 608 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 609 | AC_DEFINE([BROKEN_INET_NTOA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 610 | [Define if you system's inet_ntoa is busted |
| 611 | (e.g. Irix gcc issue)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 612 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 613 | AC_DEFINE([BROKEN_SETREUID]) |
| 614 | AC_DEFINE([BROKEN_SETREGID]) |
| 615 | AC_DEFINE([WITH_ABBREV_NO_TTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 616 | [Define if you shouldn't strip 'tty' from your |
| 617 | ttyname in [uw]tmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 618 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 619 | ;; |
| 620 | *-*-irix6*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 621 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 622 | AC_DEFINE([WITH_IRIX_ARRAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 623 | [Define if you have/want arrays |
| 624 | (cluster-wide session managment, not C arrays)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 625 | AC_DEFINE([WITH_IRIX_PROJECT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 626 | [Define if you want IRIX project management]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 627 | AC_DEFINE([WITH_IRIX_AUDIT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 628 | [Define if you want IRIX audit trails]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 629 | AC_CHECK_FUNC([jlimit_startjob], [AC_DEFINE([WITH_IRIX_JOBS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 630 | [Define if you want IRIX kernel jobs])]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 631 | AC_DEFINE([BROKEN_INET_NTOA]) |
| 632 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 633 | AC_DEFINE([BROKEN_SETREUID]) |
| 634 | AC_DEFINE([BROKEN_SETREGID]) |
| 635 | AC_DEFINE([BROKEN_UPDWTMPX], [1], [updwtmpx is broken (if present)]) |
| 636 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 637 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 638 | ;; |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 639 | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) |
| 640 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 641 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 642 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"]) |
| 643 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 644 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 645 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 646 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 647 | *-*-linux*) |
| 648 | no_dev_ptmx=1 |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 649 | check_for_libcrypt_later=1 |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 650 | check_for_openpty_ctty_bug=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 651 | AC_DEFINE([PAM_TTY_KLUDGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 652 | [Work around problematic Linux PAM modules handling of PAM_TTY]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 653 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 654 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 655 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 656 | AC_DEFINE([LINK_OPNOTSUPP_ERRNO], [EPERM], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 657 | [Define to whatever link() returns for "not supported" |
| 658 | if it doesn't return EOPNOTSUPP.]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 659 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 660 | AC_DEFINE([USE_BTMP]) |
| 661 | AC_DEFINE([LINUX_OOM_ADJUST], [1], [Adjust Linux out-of-memory killer]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 662 | inet6_default_4in6=yes |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 663 | case `uname -r` in |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 664 | 1.*|2.0.*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 665 | AC_DEFINE([BROKEN_CMSG_TYPE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 666 | [Define if cmsg_type is not passed correctly]) |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 667 | ;; |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 668 | esac |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 669 | # tun(4) forwarding compat code |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 670 | AC_CHECK_HEADERS([linux/if_tun.h]) |
Damien Miller | bd4e410 | 2006-01-01 21:03:30 +1100 | [diff] [blame] | 671 | if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 672 | AC_DEFINE([SSH_TUN_LINUX], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 673 | [Open tunnel devices the Linux tun/tap way]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 674 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 675 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 676 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 677 | [Prepend the address family to IP tunnel traffic]) |
| 678 | fi |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 679 | AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h], [], |
| 680 | [], [#include <linux/types.h>]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 681 | AC_CHECK_FUNCS([prctl]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 682 | AC_MSG_CHECKING([for seccomp architecture]) |
| 683 | seccomp_audit_arch= |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 684 | case "$host" in |
| 685 | x86_64-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 686 | seccomp_audit_arch=AUDIT_ARCH_X86_64 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 687 | ;; |
| 688 | i*86-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 689 | seccomp_audit_arch=AUDIT_ARCH_I386 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 690 | ;; |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 691 | arm*-*) |
| 692 | seccomp_audit_arch=AUDIT_ARCH_ARM |
| 693 | ;; |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 694 | esac |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 695 | if test "x$seccomp_audit_arch" != "x" ; then |
| 696 | AC_MSG_RESULT(["$seccomp_audit_arch"]) |
| 697 | AC_DEFINE_UNQUOTED([SECCOMP_AUDIT_ARCH], [$seccomp_audit_arch], |
| 698 | [Specify the system call convention in use]) |
| 699 | else |
| 700 | AC_MSG_RESULT([architecture not supported]) |
| 701 | fi |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 702 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 703 | mips-sony-bsd|mips-sony-newsos4) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 704 | AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to acquire controlling tty]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 705 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 706 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 707 | *-*-netbsd*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 708 | check_for_libcrypt_before=1 |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 709 | if test "x$withval" != "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 710 | need_dash_r=1 |
| 711 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 712 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 713 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 714 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 715 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 716 | [Prepend the address family to IP tunnel traffic]) |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 717 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 718 | *-*-freebsd*) |
| 719 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 720 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["*LOCKED*"], [Account locked with pw(1)]) |
| 721 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 722 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 723 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 724 | AC_DEFINE([BROKEN_GLOB], [1], [FreeBSD glob does not do what we need]) |
Damien Miller | 63b4bcd | 2013-03-20 12:55:14 +1100 | [diff] [blame] | 725 | AC_DEFINE([BROKEN_STRNVIS], [1], [FreeBSD strnvis does not do what we need]) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 726 | ;; |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 727 | *-*-bsdi*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 728 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 729 | AC_DEFINE([BROKEN_SETREUID]) |
| 730 | AC_DEFINE([BROKEN_SETREGID]) |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 731 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 732 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 733 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 734 | conf_utmp_location=/etc/utmp |
| 735 | conf_wtmp_location=/usr/adm/wtmp |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 736 | maildir=/usr/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 737 | AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) |
| 738 | AC_DEFINE([BROKEN_REALPATH]) |
| 739 | AC_DEFINE([USE_PIPES]) |
| 740 | AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 741 | ;; |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 742 | *-*-openbsd*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 743 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) |
| 744 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) |
| 745 | AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) |
| 746 | AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1], |
Damien Miller | bb59814 | 2006-08-19 08:38:23 +1000 | [diff] [blame] | 747 | [syslog_r function is safe to use in in a signal handler]) |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 748 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 749 | *-*-solaris*) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 750 | if test "x$withval" != "xno" ; then |
Tim Rice | ad4a188 | 2004-02-29 15:53:37 -0800 | [diff] [blame] | 751 | need_dash_r=1 |
| 752 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 753 | AC_DEFINE([PAM_SUN_CODEBASE]) |
| 754 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
| 755 | AC_DEFINE([LOGIN_NEEDS_TERM], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 756 | [Some versions of /bin/login need the TERM supplied |
| 757 | on the commandline]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 758 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 759 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 760 | [Define if pam_chauthtok wants real uid set |
| 761 | to the unpriv'ed user]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 762 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 763 | # Pushing STREAMS modules will cause sshd to acquire a controlling tty. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 764 | AC_DEFINE([SSHD_ACQUIRES_CTTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 765 | [Define if sshd somehow reacquires a controlling TTY |
| 766 | after setsid()]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 767 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd |
Darren Tucker | 0249f93 | 2006-06-24 12:10:07 +1000 | [diff] [blame] | 768 | in case the name is longer than 8 chars]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 769 | AC_DEFINE([BROKEN_TCGETATTR_ICANON], [1], [tcgetattr with ICANON may hang]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 770 | external_path_file=/etc/default/login |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 771 | # hardwire lastlog location (can't detect it on some versions) |
| 772 | conf_lastlog_location="/var/adm/lastlog" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 773 | AC_MSG_CHECKING([for obsolete utmp and wtmp in solaris2.x]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 774 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 775 | if test "$sol2ver" -ge 8; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 776 | AC_MSG_RESULT([yes]) |
| 777 | AC_DEFINE([DISABLE_UTMP]) |
| 778 | AC_DEFINE([DISABLE_WTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 779 | [Define if you don't want to use wtmp]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 780 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 781 | AC_MSG_RESULT([no]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 782 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 783 | AC_ARG_WITH([solaris-contracts], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 784 | [ --with-solaris-contracts Enable Solaris process contracts (experimental)], |
| 785 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 786 | AC_CHECK_LIB([contract], [ct_tmpl_activate], |
| 787 | [ AC_DEFINE([USE_SOLARIS_PROCESS_CONTRACTS], [1], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 788 | [Define if you have Solaris process contracts]) |
| 789 | SSHDLIBS="$SSHDLIBS -lcontract" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 790 | SPC_MSG="yes" ], ) |
| 791 | ], |
| 792 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 793 | AC_ARG_WITH([solaris-projects], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 794 | [ --with-solaris-projects Enable Solaris projects (experimental)], |
| 795 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 796 | AC_CHECK_LIB([project], [setproject], |
| 797 | [ AC_DEFINE([USE_SOLARIS_PROJECTS], [1], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 798 | [Define if you have Solaris projects]) |
| 799 | SSHDLIBS="$SSHDLIBS -lproject" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 800 | SP_MSG="yes" ], ) |
| 801 | ], |
| 802 | ) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 803 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 804 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 805 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 806 | AC_CHECK_FUNCS([getpwanam]) |
| 807 | AC_DEFINE([PAM_SUN_CODEBASE]) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 808 | conf_utmp_location=/etc/utmp |
| 809 | conf_wtmp_location=/var/adm/wtmp |
| 810 | conf_lastlog_location=/var/adm/lastlog |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 811 | AC_DEFINE([USE_PIPES]) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 812 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 813 | *-ncr-sysv*) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 814 | LIBS="$LIBS -lc89" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 815 | AC_DEFINE([USE_PIPES]) |
| 816 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 817 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 818 | AC_DEFINE([BROKEN_SETREUID]) |
| 819 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 820 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 821 | *-sni-sysv*) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 822 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 823 | AC_CHECK_LIB([dl], [dlsym], ,) |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 824 | # -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] | 825 | AC_CHECK_LIB([resolv], [res_query], [ LIBS="$LIBS -lresolv" ]) |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 826 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 827 | AC_DEFINE([USE_PIPES]) |
| 828 | AC_DEFINE([IP_TOS_IS_BROKEN]) |
| 829 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 830 | AC_DEFINE([BROKEN_SETREUID]) |
| 831 | AC_DEFINE([BROKEN_SETREGID]) |
| 832 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 833 | external_path_file=/etc/default/login |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 834 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 835 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 836 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 837 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 838 | # 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] | 839 | *-*-sysv4.2*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 840 | AC_DEFINE([USE_PIPES]) |
| 841 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 842 | AC_DEFINE([BROKEN_SETREUID]) |
| 843 | AC_DEFINE([BROKEN_SETREGID]) |
| 844 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd]) |
| 845 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 846 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 847 | # UnixWare 7.x, OpenUNIX 8 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 848 | *-*-sysv5*) |
Tim Rice | 641ebf1 | 2010-01-17 17:05:39 -0800 | [diff] [blame] | 849 | CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 850 | AC_DEFINE([UNIXWARE_LONG_PASSWORDS], [1], [Support passwords > 8 chars]) |
| 851 | AC_DEFINE([USE_PIPES]) |
| 852 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 853 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 854 | AC_DEFINE([BROKEN_SETREUID]) |
| 855 | AC_DEFINE([BROKEN_SETREGID]) |
| 856 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 857 | case "$host" in |
| 858 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 859 | maildir=/var/spool/mail |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 860 | TEST_SHELL=/u95/bin/sh |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 861 | AC_DEFINE([BROKEN_LIBIAF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 862 | [ia_uinfo routines not supported by OS yet]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 863 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 864 | AC_CHECK_LIB([prot], [getluid], [ LIBS="$LIBS -lprot" |
| 865 | AC_CHECK_FUNCS([getluid setluid], , , [-lprot]) |
| 866 | AC_DEFINE([HAVE_SECUREWARE]) |
| 867 | AC_DEFINE([DISABLE_SHADOW]) |
| 868 | ], , ) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 869 | ;; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 870 | *) AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 2676791 | 2009-01-07 20:50:08 -0800 | [diff] [blame] | 871 | check_for_libcrypt_later=1 |
Tim Rice | 46259d8 | 2005-11-28 18:40:34 -0800 | [diff] [blame] | 872 | ;; |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 873 | esac |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 874 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 875 | *-*-sysv*) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 876 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 877 | # SCO UNIX and OEM versions of SCO UNIX |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 878 | *-*-sco3.2v4*) |
Tim Rice | c390c8d | 2005-03-07 01:21:37 -0800 | [diff] [blame] | 879 | AC_MSG_ERROR("This Platform is no longer supported.") |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 880 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 881 | # SCO OpenServer 5.x |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 882 | *-*-sco3.2v5*) |
Tim Rice | 89fe3f3 | 2003-01-19 20:20:24 -0800 | [diff] [blame] | 883 | if test -z "$GCC"; then |
| 884 | CFLAGS="$CFLAGS -belf" |
| 885 | fi |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 886 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 887 | no_dev_ptmx=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 888 | AC_DEFINE([USE_PIPES]) |
| 889 | AC_DEFINE([HAVE_SECUREWARE]) |
| 890 | AC_DEFINE([DISABLE_SHADOW]) |
| 891 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 892 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 893 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 894 | AC_DEFINE([BROKEN_SETREUID]) |
| 895 | AC_DEFINE([BROKEN_SETREGID]) |
| 896 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 897 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 898 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
| 899 | AC_CHECK_FUNCS([getluid setluid]) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 900 | MANTYPE=man |
Tim Rice | f7ba8f6 | 2004-06-20 10:37:32 -0700 | [diff] [blame] | 901 | TEST_SHELL=ksh |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 902 | SKIP_DISABLE_LASTLOG_DEFINE=yes |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 903 | ;; |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 904 | *-*-unicosmk*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 905 | AC_DEFINE([NO_SSH_LASTLOG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 906 | [Define if you don't want to use lastlog in session.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 907 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 908 | AC_DEFINE([BROKEN_SETREUID]) |
| 909 | AC_DEFINE([BROKEN_SETREGID]) |
| 910 | AC_DEFINE([USE_PIPES]) |
| 911 | AC_DEFINE([DISABLE_FD_PASSING]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 912 | LDFLAGS="$LDFLAGS" |
| 913 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 914 | MANTYPE=cat |
Ben Lindstrom | 762104e | 2002-07-23 00:00:05 +0000 | [diff] [blame] | 915 | ;; |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 916 | *-*-unicosmp*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 917 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 918 | AC_DEFINE([BROKEN_SETREUID]) |
| 919 | AC_DEFINE([BROKEN_SETREGID]) |
| 920 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 921 | AC_DEFINE([USE_PIPES]) |
| 922 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 923 | LDFLAGS="$LDFLAGS" |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 924 | LIBS="$LIBS -lgen -lacid -ldb" |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 925 | MANTYPE=cat |
| 926 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 927 | *-*-unicos*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 928 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 929 | AC_DEFINE([BROKEN_SETREUID]) |
| 930 | AC_DEFINE([BROKEN_SETREGID]) |
| 931 | AC_DEFINE([USE_PIPES]) |
| 932 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 933 | AC_DEFINE([NO_SSH_LASTLOG]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 934 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" |
| 935 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 936 | MANTYPE=cat |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 937 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 938 | *-dec-osf*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 939 | AC_MSG_CHECKING([for Digital Unix SIA]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 940 | no_osfsia="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 941 | AC_ARG_WITH([osfsia], |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 942 | [ --with-osfsia Enable Digital Unix SIA], |
| 943 | [ |
| 944 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 945 | AC_MSG_RESULT([disabled]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 946 | no_osfsia=1 |
| 947 | fi |
| 948 | ], |
| 949 | ) |
| 950 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 951 | if test -f /etc/sia/matrix.conf; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 952 | AC_MSG_RESULT([yes]) |
| 953 | AC_DEFINE([HAVE_OSF_SIA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 954 | [Define if you have Digital Unix Security |
| 955 | Integration Architecture]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 956 | AC_DEFINE([DISABLE_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 957 | [Define if you don't want to use your |
| 958 | system's login() call]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 959 | AC_DEFINE([DISABLE_FD_PASSING]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 960 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 961 | SIA_MSG="yes" |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 962 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 963 | AC_MSG_RESULT([no]) |
| 964 | AC_DEFINE([LOCKED_PASSWD_SUBSTR], ["Nologin"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 965 | [String used in /etc/passwd to denote locked account]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 966 | fi |
| 967 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 968 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 969 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 970 | AC_DEFINE([BROKEN_SETREUID]) |
| 971 | AC_DEFINE([BROKEN_SETREGID]) |
| 972 | AC_DEFINE([BROKEN_READV_COMPARISON], [1], [Can't do comparisons on readv]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 973 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 974 | |
Tim Rice | 70335a6 | 2006-02-04 17:42:58 -0800 | [diff] [blame] | 975 | *-*-nto-qnx*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 976 | AC_DEFINE([USE_PIPES]) |
| 977 | AC_DEFINE([NO_X11_UNIX_SOCKETS]) |
| 978 | AC_DEFINE([MISSING_NFDBITS], [1], [Define on *nto-qnx systems]) |
| 979 | AC_DEFINE([MISSING_HOWMANY], [1], [Define on *nto-qnx systems]) |
| 980 | AC_DEFINE([MISSING_FD_MASK], [1], [Define on *nto-qnx systems]) |
| 981 | AC_DEFINE([DISABLE_LASTLOG]) |
| 982 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 983 | AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken]) |
Tim Rice | 2f99346 | 2006-02-11 18:37:48 -0800 | [diff] [blame] | 984 | enable_etc_default_login=no # has incompatible /etc/default/login |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 985 | case "$host" in |
| 986 | *-*-nto-qnx6*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 987 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 988 | ;; |
| 989 | esac |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 990 | ;; |
Darren Tucker | 2be1cbb | 2005-05-27 21:13:40 +1000 | [diff] [blame] | 991 | |
| 992 | *-*-ultrix*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 993 | AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) |
| 994 | AC_DEFINE([BROKEN_MMAP], [1], [Ultrix mmap can't map files]) |
| 995 | AC_DEFINE([NEED_SETPGRP]) |
| 996 | 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] | 997 | ;; |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 998 | |
| 999 | *-*-lynxos) |
| 1000 | CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1001 | AC_DEFINE([MISSING_HOWMANY]) |
| 1002 | AC_DEFINE([BROKEN_SETVBUF], [1], [LynxOS has broken setvbuf() implementation]) |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 1003 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1004 | esac |
| 1005 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1006 | AC_MSG_CHECKING([compiler and flags for sanity]) |
| 1007 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])], |
| 1008 | [ AC_MSG_RESULT([yes]) ], |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1009 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1010 | AC_MSG_RESULT([no]) |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1011 | AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1012 | ], |
| 1013 | [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1014 | ) |
| 1015 | |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1016 | dnl Checks for header files. |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1017 | # Checks for libraries. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1018 | AC_CHECK_FUNC([yp_match], , [AC_CHECK_LIB([nsl], [yp_match])]) |
| 1019 | AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])]) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1020 | |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1021 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1022 | AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [ |
| 1023 | AC_CHECK_LIB([gen], [dirname], [ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1024 | AC_CACHE_CHECK([for broken dirname], |
| 1025 | ac_cv_have_broken_dirname, [ |
| 1026 | save_LIBS="$LIBS" |
| 1027 | LIBS="$LIBS -lgen" |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1028 | AC_RUN_IFELSE( |
| 1029 | [AC_LANG_SOURCE([[ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1030 | #include <libgen.h> |
| 1031 | #include <string.h> |
| 1032 | |
| 1033 | int main(int argc, char **argv) { |
| 1034 | char *s, buf[32]; |
| 1035 | |
| 1036 | strncpy(buf,"/etc", 32); |
| 1037 | s = dirname(buf); |
| 1038 | if (!s || strncmp(s, "/", 32) != 0) { |
| 1039 | exit(1); |
| 1040 | } else { |
| 1041 | exit(0); |
| 1042 | } |
| 1043 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1044 | ]])], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1045 | [ ac_cv_have_broken_dirname="no" ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1046 | [ ac_cv_have_broken_dirname="yes" ], |
| 1047 | [ ac_cv_have_broken_dirname="no" ], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1048 | ) |
| 1049 | LIBS="$save_LIBS" |
| 1050 | ]) |
| 1051 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
| 1052 | LIBS="$LIBS -lgen" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1053 | AC_DEFINE([HAVE_DIRNAME]) |
| 1054 | AC_CHECK_HEADERS([libgen.h]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1055 | fi |
| 1056 | ]) |
| 1057 | ]) |
| 1058 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1059 | AC_CHECK_FUNC([getspnam], , |
| 1060 | [AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])]) |
| 1061 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], |
| 1062 | [Define if you have the basename function.])]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1063 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1064 | dnl zlib is required |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1065 | AC_ARG_WITH([zlib], |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1066 | [ --with-zlib=PATH Use zlib in PATH], |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1067 | [ if test "x$withval" = "xno" ; then |
| 1068 | AC_MSG_ERROR([*** zlib is required ***]) |
| 1069 | elif test "x$withval" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1070 | if test -d "$withval/lib"; then |
| 1071 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1072 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1073 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1074 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1075 | fi |
| 1076 | else |
| 1077 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1078 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1079 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1080 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1081 | fi |
| 1082 | fi |
| 1083 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1084 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1085 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1086 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1087 | fi |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1088 | fi ] |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1089 | ) |
| 1090 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1091 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) |
| 1092 | AC_CHECK_LIB([z], [deflate], , |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1093 | [ |
| 1094 | saved_CPPFLAGS="$CPPFLAGS" |
| 1095 | saved_LDFLAGS="$LDFLAGS" |
| 1096 | save_LIBS="$LIBS" |
| 1097 | dnl Check default zlib install dir |
| 1098 | if test -n "${need_dash_r}"; then |
| 1099 | LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}" |
| 1100 | else |
| 1101 | LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" |
| 1102 | fi |
| 1103 | CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" |
| 1104 | LIBS="$LIBS -lz" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1105 | AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])], |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1106 | [ |
| 1107 | AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) |
| 1108 | ] |
| 1109 | ) |
| 1110 | ] |
| 1111 | ) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1112 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1113 | AC_ARG_WITH([zlib-version-check], |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1114 | [ --without-zlib-version-check Disable zlib version check], |
| 1115 | [ if test "x$withval" = "xno" ; then |
| 1116 | zlib_check_nonfatal=1 |
| 1117 | fi |
| 1118 | ] |
| 1119 | ) |
| 1120 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1121 | AC_MSG_CHECKING([for possibly buggy zlib]) |
| 1122 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1123 | #include <stdio.h> |
Darren Tucker | c8a0f27 | 2013-03-22 12:49:14 +1100 | [diff] [blame] | 1124 | #include <stdlib.h> |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1125 | #include <zlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1126 | ]], |
| 1127 | [[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1128 | int a=0, b=0, c=0, d=0, n, v; |
| 1129 | n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); |
| 1130 | if (n != 3 && n != 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1131 | exit(1); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1132 | v = a*1000000 + b*10000 + c*100 + d; |
| 1133 | fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); |
| 1134 | |
| 1135 | /* 1.1.4 is OK */ |
| 1136 | if (a == 1 && b == 1 && c >= 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1137 | exit(0); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1138 | |
Darren Tucker | 41097ed | 2005-07-25 15:24:21 +1000 | [diff] [blame] | 1139 | /* 1.2.3 and up are OK */ |
| 1140 | if (v >= 1020300) |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1141 | exit(0); |
| 1142 | |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1143 | exit(2); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1144 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1145 | AC_MSG_RESULT([no]), |
| 1146 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1147 | if test -z "$zlib_check_nonfatal" ; then |
| 1148 | AC_MSG_ERROR([*** zlib too old - check config.log *** |
| 1149 | Your reported zlib version has known security problems. It's possible your |
| 1150 | vendor has fixed these problems without changing the version number. If you |
| 1151 | are sure this is the case, you can disable the check by running |
| 1152 | "./configure --without-zlib-version-check". |
Darren Tucker | ac1910f | 2005-07-26 12:00:42 +1000 | [diff] [blame] | 1153 | 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] | 1154 | See http://www.gzip.org/zlib/ for details.]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1155 | else |
| 1156 | AC_MSG_WARN([zlib version may have security problems]) |
| 1157 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1158 | ], |
| 1159 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1160 | ) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1161 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1162 | dnl UnixWare 2.x |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1163 | AC_CHECK_FUNC([strcasecmp], |
| 1164 | [], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1165 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1166 | AC_CHECK_FUNCS([utimes], |
| 1167 | [], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES]) |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 1168 | LIBS="$LIBS -lc89"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1169 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1170 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1171 | dnl Checks for libutil functions |
Damien Miller | b87f6b7 | 2013-02-23 09:12:23 +1100 | [diff] [blame] | 1172 | AC_CHECK_HEADERS([bsd/libutil.h libutil.h]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1173 | AC_SEARCH_LIBS([fmt_scaled], [util bsd]) |
| 1174 | AC_SEARCH_LIBS([login], [util bsd]) |
| 1175 | AC_SEARCH_LIBS([logout], [util bsd]) |
| 1176 | AC_SEARCH_LIBS([logwtmp], [util bsd]) |
| 1177 | AC_SEARCH_LIBS([openpty], [util bsd]) |
| 1178 | AC_SEARCH_LIBS([updwtmp], [util bsd]) |
| 1179 | AC_CHECK_FUNCS([fmt_scaled login logout openpty updwtmp logwtmp]) |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1180 | |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 1181 | AC_FUNC_STRFTIME |
| 1182 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1183 | # Check for ALTDIRFUNC glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1184 | AC_MSG_CHECKING([for GLOB_ALTDIRFUNC support]) |
| 1185 | AC_EGREP_CPP([FOUNDIT], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1186 | [ |
| 1187 | #include <glob.h> |
| 1188 | #ifdef GLOB_ALTDIRFUNC |
| 1189 | FOUNDIT |
| 1190 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1191 | ], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1192 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1193 | AC_DEFINE([GLOB_HAS_ALTDIRFUNC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1194 | [Define if your system glob() function has |
| 1195 | the GLOB_ALTDIRFUNC extension]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1196 | AC_MSG_RESULT([yes]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1197 | ], |
| 1198 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1199 | AC_MSG_RESULT([no]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1200 | ] |
| 1201 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1202 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1203 | # Check for g.gl_matchc glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1204 | AC_MSG_CHECKING([for gl_matchc field in glob_t]) |
| 1205 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], |
| 1206 | [[ glob_t g; g.gl_matchc = 1; ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1207 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1208 | AC_DEFINE([GLOB_HAS_GL_MATCHC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1209 | [Define if your system glob() function has |
| 1210 | gl_matchc options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1211 | AC_MSG_RESULT([yes]) |
| 1212 | ], [ |
| 1213 | AC_MSG_RESULT([no]) |
| 1214 | ]) |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1215 | |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1216 | # Check for g.gl_statv glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1217 | AC_MSG_CHECKING([for gl_statv and GLOB_KEEPSTAT extensions for glob]) |
| 1218 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], [[ |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1219 | #ifndef GLOB_KEEPSTAT |
| 1220 | #error "glob does not support GLOB_KEEPSTAT extension" |
| 1221 | #endif |
| 1222 | glob_t g; |
| 1223 | g.gl_statv = NULL; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1224 | ]])], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1225 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1226 | AC_DEFINE([GLOB_HAS_GL_STATV], [1], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1227 | [Define if your system glob() function has |
| 1228 | gl_statv options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1229 | AC_MSG_RESULT([yes]) |
| 1230 | ], [ |
| 1231 | AC_MSG_RESULT([no]) |
| 1232 | |
| 1233 | ]) |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1234 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1235 | AC_CHECK_DECLS([GLOB_NOMATCH], , , [#include <glob.h>]) |
Darren Tucker | 096faec | 2006-09-01 20:29:10 +1000 | [diff] [blame] | 1236 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1237 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1238 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1239 | [AC_LANG_PROGRAM([[ |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1240 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1241 | #include <dirent.h>]], |
| 1242 | [[ |
| 1243 | struct dirent d; |
| 1244 | exit(sizeof(d.d_name)<=sizeof(char)); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1245 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1246 | [AC_MSG_RESULT([yes])], |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1247 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1248 | AC_MSG_RESULT([no]) |
| 1249 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1], |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 1250 | [Define if your struct dirent expects you to |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1251 | allocate extra space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1252 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1253 | [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1254 | AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1255 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1256 | ] |
| 1257 | ) |
| 1258 | |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1259 | AC_MSG_CHECKING([for /proc/pid/fd directory]) |
| 1260 | if test -d "/proc/$$/fd" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1261 | AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd]) |
| 1262 | AC_MSG_RESULT([yes]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1263 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1264 | AC_MSG_RESULT([no]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1265 | fi |
| 1266 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1267 | # Check whether user wants S/Key support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1268 | SKEY_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1269 | AC_ARG_WITH([skey], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1270 | [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1271 | [ |
| 1272 | if test "x$withval" != "xno" ; then |
| 1273 | |
| 1274 | if test "x$withval" != "xyes" ; then |
| 1275 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1276 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1277 | fi |
| 1278 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1279 | AC_DEFINE([SKEY], [1], [Define if you want S/Key support]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1280 | LIBS="-lskey $LIBS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1281 | SKEY_MSG="yes" |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1282 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1283 | AC_MSG_CHECKING([for s/key support]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1284 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1285 | [AC_LANG_PROGRAM([[ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1286 | #include <stdio.h> |
| 1287 | #include <skey.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1288 | ]], [[ |
| 1289 | char *ff = skey_keyinfo(""); ff=""; |
| 1290 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1291 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1292 | [AC_MSG_RESULT([yes])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1293 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1294 | AC_MSG_RESULT([no]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1295 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 1296 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1297 | AC_MSG_CHECKING([if skeychallenge takes 4 arguments]) |
| 1298 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1299 | #include <stdio.h> |
| 1300 | #include <skey.h> |
| 1301 | ]], [[ |
| 1302 | (void)skeychallenge(NULL,"name","",0); |
| 1303 | ]])], |
| 1304 | [ |
| 1305 | AC_MSG_RESULT([yes]) |
| 1306 | AC_DEFINE([SKEYCHALLENGE_4ARG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1307 | [Define if your skeychallenge() |
| 1308 | function takes 4 arguments (NetBSD)])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1309 | [ |
| 1310 | AC_MSG_RESULT([no]) |
| 1311 | ]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1312 | fi |
| 1313 | ] |
| 1314 | ) |
| 1315 | |
| 1316 | # Check whether user wants TCP wrappers support |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1317 | TCPW_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1318 | AC_ARG_WITH([tcp-wrappers], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1319 | [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1320 | [ |
| 1321 | if test "x$withval" != "xno" ; then |
| 1322 | saved_LIBS="$LIBS" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1323 | saved_LDFLAGS="$LDFLAGS" |
| 1324 | saved_CPPFLAGS="$CPPFLAGS" |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 1325 | if test -n "${withval}" && \ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 1326 | test "x${withval}" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1327 | if test -d "${withval}/lib"; then |
| 1328 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1329 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1330 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1331 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1332 | fi |
| 1333 | else |
| 1334 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1335 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1336 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1337 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1338 | fi |
| 1339 | fi |
| 1340 | if test -d "${withval}/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1341 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1342 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1343 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1344 | fi |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1345 | fi |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 1346 | LIBS="-lwrap $LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1347 | AC_MSG_CHECKING([for libwrap]) |
| 1348 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 0ac4500 | 2004-04-14 20:14:26 +1000 | [diff] [blame] | 1349 | #include <sys/types.h> |
| 1350 | #include <sys/socket.h> |
| 1351 | #include <netinet/in.h> |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1352 | #include <tcpd.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1353 | int deny_severity = 0, allow_severity = 0; |
| 1354 | ]], [[ |
| 1355 | hosts_access(0); |
| 1356 | ]])], [ |
| 1357 | AC_MSG_RESULT([yes]) |
| 1358 | AC_DEFINE([LIBWRAP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1359 | [Define if you want |
| 1360 | TCP Wrappers support]) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 1361 | SSHDLIBS="$SSHDLIBS -lwrap" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1362 | TCPW_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1363 | ], [ |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1364 | AC_MSG_ERROR([*** libwrap missing]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1365 | |
| 1366 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1367 | LIBS="$saved_LIBS" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1368 | fi |
| 1369 | ] |
| 1370 | ) |
| 1371 | |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1372 | # Check whether user wants to use ldns |
| 1373 | LDNS_MSG="no" |
| 1374 | AC_ARG_WITH(ldns, |
| 1375 | [ --with-ldns[[=PATH]] Use ldns for DNSSEC support (optionally in PATH)], |
| 1376 | [ |
| 1377 | if test "x$withval" != "xno" ; then |
| 1378 | |
| 1379 | if test "x$withval" != "xyes" ; then |
| 1380 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1381 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1382 | fi |
| 1383 | |
| 1384 | AC_DEFINE(HAVE_LDNS, 1, [Define if you want ldns support]) |
| 1385 | LIBS="-lldns $LIBS" |
| 1386 | LDNS_MSG="yes" |
| 1387 | |
| 1388 | AC_MSG_CHECKING([for ldns support]) |
| 1389 | AC_LINK_IFELSE( |
| 1390 | [AC_LANG_SOURCE([[ |
| 1391 | #include <stdio.h> |
| 1392 | #include <stdlib.h> |
| 1393 | #include <stdint.h> |
| 1394 | #include <ldns/ldns.h> |
| 1395 | int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); } |
| 1396 | ]]) |
| 1397 | ], |
| 1398 | [AC_MSG_RESULT(yes)], |
| 1399 | [ |
| 1400 | AC_MSG_RESULT(no) |
| 1401 | AC_MSG_ERROR([** Incomplete or missing ldns libraries.]) |
| 1402 | ]) |
| 1403 | fi |
| 1404 | ] |
| 1405 | ) |
| 1406 | |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1407 | # Check whether user wants libedit support |
| 1408 | LIBEDIT_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1409 | AC_ARG_WITH([libedit], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1410 | [ --with-libedit[[=PATH]] Enable libedit support for sftp], |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1411 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1412 | if test "x$withval" = "xyes" ; then |
Darren Tucker | 5935389 | 2012-05-19 15:24:37 +1000 | [diff] [blame] | 1413 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1414 | if test "x$PKGCONFIG" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1415 | AC_MSG_CHECKING([if $PKGCONFIG knows about libedit]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1416 | if "$PKGCONFIG" libedit; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1417 | AC_MSG_RESULT([yes]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1418 | use_pkgconfig_for_libedit=yes |
| 1419 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1420 | AC_MSG_RESULT([no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1421 | fi |
| 1422 | fi |
| 1423 | else |
Darren Tucker | c373a56 | 2005-09-22 20:15:08 +1000 | [diff] [blame] | 1424 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1425 | if test -n "${need_dash_r}"; then |
| 1426 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 1427 | else |
| 1428 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 1429 | fi |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1430 | fi |
Damien Miller | 1f78980 | 2010-10-11 22:35:22 +1100 | [diff] [blame] | 1431 | if test "x$use_pkgconfig_for_libedit" = "xyes"; then |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1432 | LIBEDIT=`$PKGCONFIG --libs-only-l libedit` |
| 1433 | CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" |
| 1434 | else |
| 1435 | LIBEDIT="-ledit -lcurses" |
| 1436 | fi |
| 1437 | OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1438 | AC_CHECK_LIB([edit], [el_init], |
| 1439 | [ AC_DEFINE([USE_LIBEDIT], [1], [Use libedit for sftp]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1440 | LIBEDIT_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1441 | AC_SUBST([LIBEDIT]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1442 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1443 | [ AC_MSG_ERROR([libedit not found]) ], |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1444 | [ $OTHERLIBS ] |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1445 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1446 | AC_MSG_CHECKING([if libedit version is compatible]) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1447 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1448 | [AC_LANG_PROGRAM([[ #include <histedit.h> ]], |
| 1449 | [[ |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1450 | int i = H_SETSIZE; |
| 1451 | el_init("", NULL, NULL, NULL); |
| 1452 | exit(0); |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1453 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1454 | [ AC_MSG_RESULT([yes]) ], |
| 1455 | [ AC_MSG_RESULT([no]) |
| 1456 | AC_MSG_ERROR([libedit version is not compatible]) ] |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1457 | ) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1458 | fi ] |
| 1459 | ) |
| 1460 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1461 | AUDIT_MODULE=none |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1462 | AC_ARG_WITH([audit], |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1463 | [ --with-audit=module Enable audit support (modules=debug,bsm,linux)], |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1464 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1465 | AC_MSG_CHECKING([for supported audit module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1466 | case "$withval" in |
| 1467 | bsm) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1468 | AC_MSG_RESULT([bsm]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1469 | AUDIT_MODULE=bsm |
| 1470 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1471 | AC_CHECK_HEADERS([bsm/audit.h], [], |
| 1472 | [AC_MSG_ERROR([BSM enabled and bsm/audit.h not found])], |
Darren Tucker | 6d0d6fb | 2006-09-09 01:05:21 +1000 | [diff] [blame] | 1473 | [ |
| 1474 | #ifdef HAVE_TIME_H |
| 1475 | # include <time.h> |
| 1476 | #endif |
| 1477 | ] |
| 1478 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1479 | AC_CHECK_LIB([bsm], [getaudit], [], |
| 1480 | [AC_MSG_ERROR([BSM enabled and required library not found])]) |
| 1481 | AC_CHECK_FUNCS([getaudit], [], |
| 1482 | [AC_MSG_ERROR([BSM enabled and required function not found])]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1483 | # These are optional |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1484 | AC_CHECK_FUNCS([getaudit_addr aug_get_machine]) |
| 1485 | AC_DEFINE([USE_BSM_AUDIT], [1], [Use BSM audit module]) |
Darren Tucker | 93a2d41 | 2012-02-24 10:40:41 +1100 | [diff] [blame] | 1486 | if test "$sol2ver" -eq 11; then |
| 1487 | SSHDLIBS="$SSHDLIBS -lscf" |
| 1488 | AC_DEFINE([BROKEN_BSM_API], [1], |
| 1489 | [The system has incomplete BSM API]) |
| 1490 | fi |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1491 | ;; |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1492 | linux) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1493 | AC_MSG_RESULT([linux]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1494 | AUDIT_MODULE=linux |
| 1495 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1496 | AC_CHECK_HEADERS([libaudit.h]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1497 | SSHDLIBS="$SSHDLIBS -laudit" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1498 | AC_DEFINE([USE_LINUX_AUDIT], [1], [Use Linux audit module]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1499 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1500 | debug) |
| 1501 | AUDIT_MODULE=debug |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1502 | AC_MSG_RESULT([debug]) |
| 1503 | AC_DEFINE([SSH_AUDIT_EVENTS], [1], [Use audit debugging module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1504 | ;; |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1505 | no) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1506 | AC_MSG_RESULT([no]) |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1507 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1508 | *) |
| 1509 | AC_MSG_ERROR([Unknown audit module $withval]) |
| 1510 | ;; |
| 1511 | esac ] |
| 1512 | ) |
| 1513 | |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1514 | dnl Checks for library functions. Please keep in alphabetical order |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1515 | AC_CHECK_FUNCS([ \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1516 | arc4random \ |
Damien Miller | a4be7c2 | 2008-05-19 14:47:37 +1000 | [diff] [blame] | 1517 | arc4random_buf \ |
| 1518 | arc4random_uniform \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1519 | asprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1520 | b64_ntop \ |
| 1521 | __b64_ntop \ |
| 1522 | b64_pton \ |
| 1523 | __b64_pton \ |
| 1524 | bcopy \ |
| 1525 | bindresvport_sa \ |
| 1526 | clock \ |
| 1527 | closefrom \ |
| 1528 | dirfd \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1529 | fchmod \ |
| 1530 | fchown \ |
| 1531 | freeaddrinfo \ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 1532 | fstatvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1533 | futimes \ |
| 1534 | getaddrinfo \ |
| 1535 | getcwd \ |
| 1536 | getgrouplist \ |
| 1537 | getnameinfo \ |
| 1538 | getopt \ |
| 1539 | getpeereid \ |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1540 | getpeerucred \ |
Darren Tucker | 3c4a24c | 2013-02-15 11:41:35 +1100 | [diff] [blame] | 1541 | getpgid \ |
| 1542 | getpgrp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1543 | _getpty \ |
| 1544 | getrlimit \ |
| 1545 | getttyent \ |
| 1546 | glob \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1547 | group_from_gid \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1548 | inet_aton \ |
| 1549 | inet_ntoa \ |
| 1550 | inet_ntop \ |
| 1551 | innetgr \ |
| 1552 | login_getcapbool \ |
| 1553 | md5_crypt \ |
| 1554 | memmove \ |
| 1555 | mkdtemp \ |
| 1556 | mmap \ |
| 1557 | ngetaddrinfo \ |
| 1558 | nsleep \ |
| 1559 | ogetaddrinfo \ |
| 1560 | openlog_r \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 1561 | poll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1562 | prctl \ |
| 1563 | pstat \ |
| 1564 | readpassphrase \ |
| 1565 | realpath \ |
| 1566 | recvmsg \ |
| 1567 | rresvport_af \ |
| 1568 | sendmsg \ |
| 1569 | setdtablesize \ |
| 1570 | setegid \ |
| 1571 | setenv \ |
| 1572 | seteuid \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1573 | setgroupent \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1574 | setgroups \ |
Darren Tucker | 34f702a | 2012-07-04 08:50:09 +1000 | [diff] [blame] | 1575 | setlinebuf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1576 | setlogin \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1577 | setpassent\ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1578 | setpcred \ |
| 1579 | setproctitle \ |
| 1580 | setregid \ |
| 1581 | setreuid \ |
| 1582 | setrlimit \ |
| 1583 | setsid \ |
| 1584 | setvbuf \ |
| 1585 | sigaction \ |
| 1586 | sigvec \ |
| 1587 | snprintf \ |
| 1588 | socketpair \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 1589 | statfs \ |
| 1590 | statvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1591 | strdup \ |
| 1592 | strerror \ |
| 1593 | strlcat \ |
| 1594 | strlcpy \ |
| 1595 | strmode \ |
Darren Tucker | b54f50e | 2011-09-29 23:17:18 +1000 | [diff] [blame] | 1596 | strnlen \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1597 | strnvis \ |
Darren Tucker | aa74f67 | 2010-08-16 13:15:23 +1000 | [diff] [blame] | 1598 | strptime \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1599 | strtonum \ |
Darren Tucker | 81eb5d5 | 2005-06-01 21:39:33 +1000 | [diff] [blame] | 1600 | strtoll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1601 | strtoul \ |
Darren Tucker | 8e6fb78 | 2013-02-15 12:13:01 +1100 | [diff] [blame] | 1602 | strtoull \ |
Damien Miller | 34a1769 | 2007-06-11 14:15:42 +1000 | [diff] [blame] | 1603 | swap32 \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1604 | sysconf \ |
| 1605 | tcgetpgrp \ |
Damien Miller | aa18063 | 2010-10-07 21:25:27 +1100 | [diff] [blame] | 1606 | timingsafe_bcmp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1607 | truncate \ |
| 1608 | unsetenv \ |
| 1609 | updwtmpx \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1610 | user_from_uid \ |
Damien Miller | f4db77d | 2013-03-15 10:34:25 +1100 | [diff] [blame] | 1611 | usleep \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1612 | vasprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1613 | vhangup \ |
| 1614 | vsnprintf \ |
| 1615 | waitpid \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1616 | ]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1617 | |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1618 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1619 | [AC_LANG_PROGRAM( |
| 1620 | [[ #include <ctype.h> ]], |
| 1621 | [[ return (isblank('a')); ]])], |
| 1622 | [AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).]) |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1623 | ]) |
| 1624 | |
Damien Miller | b3c9f78 | 2010-02-12 10:11:34 +1100 | [diff] [blame] | 1625 | # PKCS#11 support requires dlopen() and co |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1626 | AC_SEARCH_LIBS([dlopen], [dl], |
| 1627 | [AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])] |
Damien Miller | b3c9f78 | 2010-02-12 10:11:34 +1100 | [diff] [blame] | 1628 | ) |
| 1629 | |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1630 | # IRIX has a const char return value for gai_strerror() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1631 | AC_CHECK_FUNCS([gai_strerror], [ |
| 1632 | AC_DEFINE([HAVE_GAI_STRERROR]) |
| 1633 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1634 | #include <sys/types.h> |
| 1635 | #include <sys/socket.h> |
| 1636 | #include <netdb.h> |
| 1637 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1638 | const char *gai_strerror(int); |
| 1639 | ]], [[ |
| 1640 | char *str; |
| 1641 | str = gai_strerror(0); |
| 1642 | ]])], [ |
| 1643 | AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1], |
| 1644 | [Define if gai_strerror() returns const char *])], [])]) |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1645 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1646 | AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], |
| 1647 | [Some systems put nanosleep outside of libc])]) |
Damien Miller | cd6853c | 2003-01-28 11:33:42 +1100 | [diff] [blame] | 1648 | |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1649 | dnl Make sure prototypes are defined for these before using them. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1650 | AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])]) |
| 1651 | AC_CHECK_DECL([strsep], |
| 1652 | [AC_CHECK_FUNCS([strsep])], |
Darren Tucker | 390b6d5 | 2005-05-28 16:54:36 +1000 | [diff] [blame] | 1653 | [], |
| 1654 | [ |
| 1655 | #ifdef HAVE_STRING_H |
| 1656 | # include <string.h> |
| 1657 | #endif |
| 1658 | ]) |
Ben Lindstrom | 3e00647 | 2002-10-16 00:24:03 +0000 | [diff] [blame] | 1659 | |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1660 | dnl tcsendbreak might be a macro |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1661 | AC_CHECK_DECL([tcsendbreak], |
| 1662 | [AC_DEFINE([HAVE_TCSENDBREAK])], |
| 1663 | [AC_CHECK_FUNCS([tcsendbreak])], |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1664 | [#include <termios.h>] |
| 1665 | ) |
| 1666 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1667 | AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>]) |
Darren Tucker | 5bb1400 | 2004-04-23 18:53:10 +1000 | [diff] [blame] | 1668 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1669 | AC_CHECK_DECLS([SHUT_RD], , , |
Darren Tucker | 128a089 | 2006-07-12 19:02:56 +1000 | [diff] [blame] | 1670 | [ |
| 1671 | #include <sys/types.h> |
| 1672 | #include <sys/socket.h> |
| 1673 | ]) |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1674 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1675 | AC_CHECK_DECLS([O_NONBLOCK], , , |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1676 | [ |
| 1677 | #include <sys/types.h> |
| 1678 | #ifdef HAVE_SYS_STAT_H |
| 1679 | # include <sys/stat.h> |
| 1680 | #endif |
| 1681 | #ifdef HAVE_FCNTL_H |
| 1682 | # include <fcntl.h> |
| 1683 | #endif |
| 1684 | ]) |
| 1685 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1686 | AC_CHECK_DECLS([writev], , , [ |
Darren Tucker | ed0b592 | 2006-09-03 22:44:49 +1000 | [diff] [blame] | 1687 | #include <sys/types.h> |
| 1688 | #include <sys/uio.h> |
| 1689 | #include <unistd.h> |
| 1690 | ]) |
| 1691 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1692 | AC_CHECK_DECLS([MAXSYMLINKS], , , [ |
Darren Tucker | 6d862a5 | 2007-04-29 14:39:02 +1000 | [diff] [blame] | 1693 | #include <sys/param.h> |
| 1694 | ]) |
| 1695 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1696 | AC_CHECK_DECLS([offsetof], , , [ |
Darren Tucker | dca0edf | 2007-04-29 15:06:44 +1000 | [diff] [blame] | 1697 | #include <stddef.h> |
| 1698 | ]) |
| 1699 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1700 | AC_CHECK_FUNCS([setresuid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1701 | dnl Some platorms have setresuid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1702 | AC_MSG_CHECKING([if setresuid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1703 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1704 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1705 | #include <stdlib.h> |
| 1706 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1707 | ]], [[ |
| 1708 | errno=0; |
| 1709 | setresuid(0,0,0); |
| 1710 | if (errno==ENOSYS) |
| 1711 | exit(1); |
| 1712 | else |
| 1713 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1714 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1715 | [AC_MSG_RESULT([yes])], |
| 1716 | [AC_DEFINE([BROKEN_SETRESUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1717 | [Define if your setresuid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1718 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1719 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1720 | ) |
| 1721 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1722 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1723 | AC_CHECK_FUNCS([setresgid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1724 | dnl Some platorms have setresgid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1725 | AC_MSG_CHECKING([if setresgid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1726 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1727 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1728 | #include <stdlib.h> |
| 1729 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1730 | ]], [[ |
| 1731 | errno=0; |
| 1732 | setresgid(0,0,0); |
| 1733 | if (errno==ENOSYS) |
| 1734 | exit(1); |
| 1735 | else |
| 1736 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1737 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1738 | [AC_MSG_RESULT([yes])], |
| 1739 | [AC_DEFINE([BROKEN_SETRESGID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1740 | [Define if your setresgid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1741 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1742 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1743 | ) |
| 1744 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1745 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1746 | dnl Checks for time functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1747 | AC_CHECK_FUNCS([gettimeofday time]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1748 | dnl Checks for utmp functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1749 | AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent]) |
| 1750 | AC_CHECK_FUNCS([utmpname]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1751 | dnl Checks for utmpx functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1752 | AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline getutxuser pututxline]) |
| 1753 | AC_CHECK_FUNCS([setutxdb setutxent utmpxname]) |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 1754 | dnl Checks for lastlog functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1755 | AC_CHECK_FUNCS([getlastlogxbyname]) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 1756 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1757 | AC_CHECK_FUNC([daemon], |
| 1758 | [AC_DEFINE([HAVE_DAEMON], [1], [Define if your libraries define daemon()])], |
| 1759 | [AC_CHECK_LIB([bsd], [daemon], |
| 1760 | [LIBS="$LIBS -lbsd"; AC_DEFINE([HAVE_DAEMON])])] |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 1761 | ) |
| 1762 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1763 | AC_CHECK_FUNC([getpagesize], |
| 1764 | [AC_DEFINE([HAVE_GETPAGESIZE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1765 | [Define if your libraries define getpagesize()])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1766 | [AC_CHECK_LIB([ucb], [getpagesize], |
| 1767 | [LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])] |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 1768 | ) |
| 1769 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1770 | # Check for broken snprintf |
| 1771 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 1772 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1773 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1774 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 1775 | [[ |
| 1776 | char b[5]; |
| 1777 | snprintf(b,5,"123456789"); |
| 1778 | exit(b[4]!='\0'); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1779 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1780 | [AC_MSG_RESULT([yes])], |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1781 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1782 | AC_MSG_RESULT([no]) |
| 1783 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1784 | [Define if your snprintf is busted]) |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1785 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1786 | ], |
| 1787 | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1788 | ) |
| 1789 | fi |
| 1790 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1791 | # If we don't have a working asprintf, then we strongly depend on vsnprintf |
| 1792 | # returning the right thing on overflow: the number of characters it tried to |
| 1793 | # create (as per SUSv3) |
| 1794 | if test "x$ac_cv_func_asprintf" != "xyes" && \ |
| 1795 | test "x$ac_cv_func_vsnprintf" = "xyes" ; then |
| 1796 | AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) |
| 1797 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1798 | [AC_LANG_PROGRAM([[ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1799 | #include <sys/types.h> |
| 1800 | #include <stdio.h> |
| 1801 | #include <stdarg.h> |
| 1802 | |
| 1803 | int x_snprintf(char *str,size_t count,const char *fmt,...) |
| 1804 | { |
| 1805 | size_t ret; va_list ap; |
| 1806 | va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap); |
| 1807 | return ret; |
| 1808 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1809 | ]], [[ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1810 | char x[1]; |
| 1811 | exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1812 | ]])], |
| 1813 | [AC_MSG_RESULT([yes])], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1814 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1815 | AC_MSG_RESULT([no]) |
| 1816 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1817 | [Define if your snprintf is busted]) |
| 1818 | AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor]) |
| 1819 | ], |
| 1820 | [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ] |
| 1821 | ) |
| 1822 | fi |
| 1823 | |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 1824 | # On systems where [v]snprintf is broken, but is declared in stdio, |
| 1825 | # check that the fmt argument is const char * or just char *. |
| 1826 | # This is only useful for when BROKEN_SNPRINTF |
| 1827 | AC_MSG_CHECKING([whether snprintf can declare const char *fmt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1828 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1829 | #include <stdio.h> |
| 1830 | int snprintf(char *a, size_t b, const char *c, ...) { return 0; } |
| 1831 | ]], [[ |
| 1832 | snprintf(0, 0, 0); |
| 1833 | ]])], |
| 1834 | [AC_MSG_RESULT([yes]) |
| 1835 | AC_DEFINE([SNPRINTF_CONST], [const], |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 1836 | [Define as const if snprintf() can declare const char *fmt])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1837 | [AC_MSG_RESULT([no]) |
| 1838 | AC_DEFINE([SNPRINTF_CONST], [/* not const */])]) |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 1839 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 1840 | # Check for missing getpeereid (or equiv) support |
| 1841 | NO_PEERCHECK="" |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1842 | 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] | 1843 | AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1844 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1845 | #include <sys/types.h> |
| 1846 | #include <sys/socket.h>]], [[int i = SO_PEERCRED;]])], |
| 1847 | [ AC_MSG_RESULT([yes]) |
| 1848 | AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have PEERCRED socket option]) |
| 1849 | ], [AC_MSG_RESULT([no]) |
| 1850 | NO_PEERCHECK=1 |
| 1851 | ]) |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 1852 | fi |
| 1853 | |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1854 | dnl see whether mkstemp() requires XXXXXX |
| 1855 | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then |
| 1856 | AC_MSG_CHECKING([for (overly) strict mkstemp]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1857 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1858 | [AC_LANG_PROGRAM([[ |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1859 | #include <stdlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1860 | ]], [[ |
| 1861 | char template[]="conftest.mkstemp-test"; |
| 1862 | if (mkstemp(template) == -1) |
| 1863 | exit(1); |
| 1864 | unlink(template); |
| 1865 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1866 | ]])], |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1867 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1868 | AC_MSG_RESULT([no]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1869 | ], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1870 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1871 | AC_MSG_RESULT([yes]) |
| 1872 | AC_DEFINE([HAVE_STRICT_MKSTEMP], [1], [Silly mkstemp()]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1873 | ], |
| 1874 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1875 | AC_MSG_RESULT([yes]) |
| 1876 | AC_DEFINE([HAVE_STRICT_MKSTEMP]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1877 | ] |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1878 | ) |
| 1879 | fi |
| 1880 | |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1881 | dnl make sure that openpty does not reacquire controlling terminal |
| 1882 | if test ! -z "$check_for_openpty_ctty_bug"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1883 | AC_MSG_CHECKING([if openpty correctly handles controlling tty]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1884 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1885 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1886 | #include <stdio.h> |
| 1887 | #include <sys/fcntl.h> |
| 1888 | #include <sys/types.h> |
| 1889 | #include <sys/wait.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1890 | ]], [[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1891 | pid_t pid; |
| 1892 | int fd, ptyfd, ttyfd, status; |
| 1893 | |
| 1894 | pid = fork(); |
| 1895 | if (pid < 0) { /* failed */ |
| 1896 | exit(1); |
| 1897 | } else if (pid > 0) { /* parent */ |
| 1898 | waitpid(pid, &status, 0); |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1899 | if (WIFEXITED(status)) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1900 | exit(WEXITSTATUS(status)); |
| 1901 | else |
| 1902 | exit(2); |
| 1903 | } else { /* child */ |
| 1904 | close(0); close(1); close(2); |
| 1905 | setsid(); |
| 1906 | openpty(&ptyfd, &ttyfd, NULL, NULL, NULL); |
| 1907 | fd = open("/dev/tty", O_RDWR | O_NOCTTY); |
| 1908 | if (fd >= 0) |
| 1909 | exit(3); /* Acquired ctty: broken */ |
| 1910 | else |
| 1911 | exit(0); /* Did not acquire ctty: OK */ |
| 1912 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1913 | ]])], |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1914 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1915 | AC_MSG_RESULT([yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1916 | ], |
| 1917 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1918 | AC_MSG_RESULT([no]) |
| 1919 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1920 | ], |
| 1921 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1922 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1923 | ] |
| 1924 | ) |
| 1925 | fi |
| 1926 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 1927 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 1928 | test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1929 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1930 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1931 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 1932 | #include <stdio.h> |
| 1933 | #include <sys/socket.h> |
| 1934 | #include <netdb.h> |
| 1935 | #include <errno.h> |
| 1936 | #include <netinet/in.h> |
| 1937 | |
| 1938 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1939 | ]], [[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 1940 | int err, sock; |
| 1941 | struct addrinfo *gai_ai, *ai, hints; |
| 1942 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 1943 | |
| 1944 | memset(&hints, 0, sizeof(hints)); |
| 1945 | hints.ai_family = PF_UNSPEC; |
| 1946 | hints.ai_socktype = SOCK_STREAM; |
| 1947 | hints.ai_flags = AI_PASSIVE; |
| 1948 | |
| 1949 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 1950 | if (err != 0) { |
| 1951 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 1952 | exit(1); |
| 1953 | } |
| 1954 | |
| 1955 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 1956 | if (ai->ai_family != AF_INET6) |
| 1957 | continue; |
| 1958 | |
| 1959 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 1960 | sizeof(ntop), strport, sizeof(strport), |
| 1961 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 1962 | |
| 1963 | if (err != 0) { |
| 1964 | if (err == EAI_SYSTEM) |
| 1965 | perror("getnameinfo EAI_SYSTEM"); |
| 1966 | else |
| 1967 | fprintf(stderr, "getnameinfo failed: %s\n", |
| 1968 | gai_strerror(err)); |
| 1969 | exit(2); |
| 1970 | } |
| 1971 | |
| 1972 | sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
| 1973 | if (sock < 0) |
| 1974 | perror("socket"); |
| 1975 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
| 1976 | if (errno == EBADF) |
| 1977 | exit(3); |
| 1978 | } |
| 1979 | } |
| 1980 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1981 | ]])], |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 1982 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1983 | AC_MSG_RESULT([yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 1984 | ], |
| 1985 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1986 | AC_MSG_RESULT([no]) |
| 1987 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1988 | ], |
| 1989 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1990 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 1991 | ] |
| 1992 | ) |
| 1993 | fi |
| 1994 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 1995 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 1996 | test "x$check_for_aix_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1997 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1998 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1999 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2000 | #include <stdio.h> |
| 2001 | #include <sys/socket.h> |
| 2002 | #include <netdb.h> |
| 2003 | #include <errno.h> |
| 2004 | #include <netinet/in.h> |
| 2005 | |
| 2006 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2007 | ]], [[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2008 | int err, sock; |
| 2009 | struct addrinfo *gai_ai, *ai, hints; |
| 2010 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2011 | |
| 2012 | memset(&hints, 0, sizeof(hints)); |
| 2013 | hints.ai_family = PF_UNSPEC; |
| 2014 | hints.ai_socktype = SOCK_STREAM; |
| 2015 | hints.ai_flags = AI_PASSIVE; |
| 2016 | |
| 2017 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2018 | if (err != 0) { |
| 2019 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2020 | exit(1); |
| 2021 | } |
| 2022 | |
| 2023 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2024 | if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) |
| 2025 | continue; |
| 2026 | |
| 2027 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2028 | sizeof(ntop), strport, sizeof(strport), |
| 2029 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2030 | |
| 2031 | if (ai->ai_family == AF_INET && err != 0) { |
| 2032 | perror("getnameinfo"); |
| 2033 | exit(2); |
| 2034 | } |
| 2035 | } |
| 2036 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2037 | ]])], |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2038 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2039 | AC_MSG_RESULT([yes]) |
| 2040 | AC_DEFINE([AIX_GETNAMEINFO_HACK], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2041 | [Define if you have a getaddrinfo that fails |
| 2042 | for the all-zeros IPv6 address]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2043 | ], |
| 2044 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2045 | AC_MSG_RESULT([no]) |
| 2046 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2047 | ], |
Darren Tucker | 8b272ab | 2006-06-27 11:20:28 +1000 | [diff] [blame] | 2048 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2049 | AC_MSG_RESULT([cross-compiling, assuming no]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2050 | ] |
| 2051 | ) |
| 2052 | fi |
| 2053 | |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2054 | if test "x$check_for_conflicting_getspnam" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2055 | AC_MSG_CHECKING([for conflicting getspnam in shadow.h]) |
| 2056 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]], |
| 2057 | [[ exit(0); ]])], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2058 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2059 | AC_MSG_RESULT([no]) |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2060 | ], |
| 2061 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2062 | AC_MSG_RESULT([yes]) |
| 2063 | AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2064 | [Conflicting defs for getspnam]) |
| 2065 | ] |
| 2066 | ) |
| 2067 | fi |
| 2068 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 2069 | AC_FUNC_GETPGRP |
| 2070 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2071 | # Search for OpenSSL |
| 2072 | saved_CPPFLAGS="$CPPFLAGS" |
| 2073 | saved_LDFLAGS="$LDFLAGS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2074 | AC_ARG_WITH([ssl-dir], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2075 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 2076 | [ |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 2077 | if test "x$withval" != "xno" ; then |
Darren Tucker | c7e38d5 | 2005-02-09 22:12:30 +1100 | [diff] [blame] | 2078 | case "$withval" in |
| 2079 | # Relative paths |
| 2080 | ./*|../*) withval="`pwd`/$withval" |
| 2081 | esac |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2082 | if test -d "$withval/lib"; then |
| 2083 | if test -n "${need_dash_r}"; then |
| 2084 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 2085 | else |
| 2086 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 2087 | fi |
Darren Tucker | 9f8703b | 2010-04-23 11:12:06 +1000 | [diff] [blame] | 2088 | elif test -d "$withval/lib64"; then |
| 2089 | if test -n "${need_dash_r}"; then |
| 2090 | LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}" |
| 2091 | else |
| 2092 | LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" |
| 2093 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2094 | else |
| 2095 | if test -n "${need_dash_r}"; then |
| 2096 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
| 2097 | else |
| 2098 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 2099 | fi |
| 2100 | fi |
| 2101 | if test -d "$withval/include"; then |
| 2102 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 2103 | else |
| 2104 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 2105 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2106 | fi |
| 2107 | ] |
| 2108 | ) |
Tim Rice | 3d5352e | 2004-02-12 09:27:21 -0800 | [diff] [blame] | 2109 | LIBS="-lcrypto $LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2110 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2111 | [Define if your ssl headers are included |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2112 | with #include <openssl/header.h>])], |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 2113 | [ |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2114 | dnl Check default openssl install dir |
| 2115 | if test -n "${need_dash_r}"; then |
| 2116 | LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 2117 | else |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2118 | LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 2119 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2120 | CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" |
Darren Tucker | 83d8f28 | 2009-08-17 09:35:22 +1000 | [diff] [blame] | 2121 | AC_CHECK_HEADER([openssl/opensslv.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2122 | [AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])]) |
| 2123 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL])], |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2124 | [ |
| 2125 | AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) |
| 2126 | ] |
| 2127 | ) |
| 2128 | ] |
| 2129 | ) |
| 2130 | |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2131 | # Determine OpenSSL header version |
| 2132 | AC_MSG_CHECKING([OpenSSL header version]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2133 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2134 | [AC_LANG_PROGRAM([[ |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2135 | #include <stdio.h> |
| 2136 | #include <string.h> |
| 2137 | #include <openssl/opensslv.h> |
| 2138 | #define DATA "conftest.sslincver" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2139 | ]], [[ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2140 | FILE *fd; |
| 2141 | int rc; |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2142 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2143 | fd = fopen(DATA,"w"); |
| 2144 | if(fd == NULL) |
| 2145 | exit(1); |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2146 | |
| 2147 | if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0) |
| 2148 | exit(1); |
| 2149 | |
| 2150 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2151 | ]])], |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2152 | [ |
| 2153 | ssl_header_ver=`cat conftest.sslincver` |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2154 | AC_MSG_RESULT([$ssl_header_ver]) |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2155 | ], |
| 2156 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2157 | AC_MSG_RESULT([not found]) |
| 2158 | AC_MSG_ERROR([OpenSSL version header not found.]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2159 | ], |
| 2160 | [ |
| 2161 | AC_MSG_WARN([cross compiling: not checking]) |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2162 | ] |
| 2163 | ) |
| 2164 | |
| 2165 | # Determine OpenSSL library version |
| 2166 | AC_MSG_CHECKING([OpenSSL library version]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2167 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2168 | [AC_LANG_PROGRAM([[ |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2169 | #include <stdio.h> |
| 2170 | #include <string.h> |
| 2171 | #include <openssl/opensslv.h> |
| 2172 | #include <openssl/crypto.h> |
| 2173 | #define DATA "conftest.ssllibver" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2174 | ]], [[ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2175 | FILE *fd; |
| 2176 | int rc; |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2177 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2178 | fd = fopen(DATA,"w"); |
| 2179 | if(fd == NULL) |
| 2180 | exit(1); |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2181 | |
| 2182 | if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0) |
| 2183 | exit(1); |
| 2184 | |
| 2185 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2186 | ]])], |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2187 | [ |
| 2188 | ssl_library_ver=`cat conftest.ssllibver` |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2189 | AC_MSG_RESULT([$ssl_library_ver]) |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2190 | ], |
| 2191 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2192 | AC_MSG_RESULT([not found]) |
| 2193 | AC_MSG_ERROR([OpenSSL library not found.]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2194 | ], |
| 2195 | [ |
| 2196 | AC_MSG_WARN([cross compiling: not checking]) |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2197 | ] |
| 2198 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2199 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2200 | AC_ARG_WITH([openssl-header-check], |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2201 | [ --without-openssl-header-check Disable OpenSSL version consistency check], |
| 2202 | [ if test "x$withval" = "xno" ; then |
| 2203 | openssl_check_nonfatal=1 |
| 2204 | fi |
| 2205 | ] |
| 2206 | ) |
| 2207 | |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2208 | # Sanity check OpenSSL headers |
| 2209 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2210 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2211 | [AC_LANG_PROGRAM([[ |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2212 | #include <string.h> |
| 2213 | #include <openssl/opensslv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2214 | ]], [[ |
| 2215 | exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2216 | ]])], |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2217 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2218 | AC_MSG_RESULT([yes]) |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2219 | ], |
| 2220 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2221 | AC_MSG_RESULT([no]) |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2222 | if test "x$openssl_check_nonfatal" = "x"; then |
| 2223 | AC_MSG_ERROR([Your OpenSSL headers do not match your |
| 2224 | library. Check config.log for details. |
| 2225 | If you are sure your installation is consistent, you can disable the check |
| 2226 | by running "./configure --without-openssl-header-check". |
| 2227 | Also see contrib/findssl.sh for help identifying header/library mismatches. |
| 2228 | ]) |
| 2229 | else |
| 2230 | AC_MSG_WARN([Your OpenSSL headers do not match your |
| 2231 | library. Check config.log for details. |
Darren Tucker | a0472e0 | 2003-06-24 20:22:09 +1000 | [diff] [blame] | 2232 | Also see contrib/findssl.sh for help identifying header/library mismatches.]) |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2233 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2234 | ], |
| 2235 | [ |
| 2236 | AC_MSG_WARN([cross compiling: not checking]) |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2237 | ] |
| 2238 | ) |
| 2239 | |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2240 | AC_MSG_CHECKING([if programs using OpenSSL functions will link]) |
| 2241 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2242 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2243 | [[ SSLeay_add_all_algorithms(); ]])], |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2244 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2245 | AC_MSG_RESULT([yes]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2246 | ], |
| 2247 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2248 | AC_MSG_RESULT([no]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2249 | saved_LIBS="$LIBS" |
| 2250 | LIBS="$LIBS -ldl" |
| 2251 | AC_MSG_CHECKING([if programs using OpenSSL need -ldl]) |
| 2252 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2253 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2254 | [[ SSLeay_add_all_algorithms(); ]])], |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2255 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2256 | AC_MSG_RESULT([yes]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2257 | ], |
| 2258 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2259 | AC_MSG_RESULT([no]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2260 | LIBS="$saved_LIBS" |
| 2261 | ] |
| 2262 | ) |
| 2263 | ] |
| 2264 | ) |
| 2265 | |
Darren Tucker | e9b3ad7 | 2012-01-17 14:03:34 +1100 | [diff] [blame] | 2266 | AC_CHECK_FUNCS([RSA_generate_key_ex DSA_generate_parameters_ex BN_is_prime_ex RSA_get_default_method HMAC_CTX_init]) |
Darren Tucker | ebdef76 | 2010-12-04 23:20:50 +1100 | [diff] [blame] | 2267 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2268 | AC_ARG_WITH([ssl-engine], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2269 | [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], |
| 2270 | [ if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2271 | AC_MSG_CHECKING([for OpenSSL ENGINE support]) |
| 2272 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2273 | #include <openssl/engine.h> |
| 2274 | ]], [[ |
| 2275 | ENGINE_load_builtin_engines(); |
| 2276 | ENGINE_register_all_complete(); |
| 2277 | ]])], |
| 2278 | [ AC_MSG_RESULT([yes]) |
| 2279 | AC_DEFINE([USE_OPENSSL_ENGINE], [1], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2280 | [Enable OpenSSL engine support]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2281 | ], [ AC_MSG_ERROR([OpenSSL ENGINE support not found]) |
| 2282 | ]) |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2283 | fi ] |
| 2284 | ) |
| 2285 | |
Darren Tucker | 129d0bb | 2005-12-19 17:40:40 +1100 | [diff] [blame] | 2286 | # Check for OpenSSL without EVP_aes_{192,256}_cbc |
| 2287 | AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) |
Darren Tucker | f1f4bdd | 2006-08-04 19:44:23 +1000 | [diff] [blame] | 2288 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2289 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 129d0bb | 2005-12-19 17:40:40 +1100 | [diff] [blame] | 2290 | #include <string.h> |
| 2291 | #include <openssl/evp.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2292 | ]], [[ |
| 2293 | exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL); |
Darren Tucker | 129d0bb | 2005-12-19 17:40:40 +1100 | [diff] [blame] | 2294 | ]])], |
| 2295 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2296 | AC_MSG_RESULT([no]) |
Darren Tucker | 129d0bb | 2005-12-19 17:40:40 +1100 | [diff] [blame] | 2297 | ], |
| 2298 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2299 | AC_MSG_RESULT([yes]) |
| 2300 | AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1], |
Darren Tucker | 129d0bb | 2005-12-19 17:40:40 +1100 | [diff] [blame] | 2301 | [libcrypto is missing AES 192 and 256 bit functions]) |
| 2302 | ] |
| 2303 | ) |
| 2304 | |
Damien Miller | 25a02b0 | 2012-12-13 08:18:56 +1100 | [diff] [blame] | 2305 | # Check for OpenSSL with EVP_aes_*ctr |
| 2306 | AC_MSG_CHECKING([whether OpenSSL has AES CTR via EVP]) |
| 2307 | AC_LINK_IFELSE( |
| 2308 | [AC_LANG_PROGRAM([[ |
| 2309 | #include <string.h> |
| 2310 | #include <openssl/evp.h> |
| 2311 | ]], [[ |
| 2312 | exit(EVP_aes_128_ctr() == NULL || |
| 2313 | EVP_aes_192_cbc() == NULL || |
| 2314 | EVP_aes_256_cbc() == NULL); |
| 2315 | ]])], |
| 2316 | [ |
| 2317 | AC_MSG_RESULT([yes]) |
| 2318 | AC_DEFINE([OPENSSL_HAVE_EVPCTR], [1], |
| 2319 | [libcrypto has EVP AES CTR]) |
| 2320 | ], |
| 2321 | [ |
| 2322 | AC_MSG_RESULT([no]) |
| 2323 | ] |
| 2324 | ) |
| 2325 | |
Damien Miller | d522c68 | 2013-01-09 16:42:47 +1100 | [diff] [blame] | 2326 | # Check for OpenSSL with EVP_aes_*gcm |
| 2327 | AC_MSG_CHECKING([whether OpenSSL has AES GCM via EVP]) |
| 2328 | AC_LINK_IFELSE( |
| 2329 | [AC_LANG_PROGRAM([[ |
| 2330 | #include <string.h> |
| 2331 | #include <openssl/evp.h> |
| 2332 | ]], [[ |
| 2333 | exit(EVP_aes_128_gcm() == NULL || |
Damien Miller | b6f73b3 | 2013-02-11 10:39:12 +1100 | [diff] [blame] | 2334 | EVP_aes_256_gcm() == NULL || |
| 2335 | EVP_CTRL_GCM_SET_IV_FIXED == 0 || |
| 2336 | EVP_CTRL_GCM_IV_GEN == 0 || |
| 2337 | EVP_CTRL_GCM_SET_TAG == 0 || |
| 2338 | EVP_CTRL_GCM_GET_TAG == 0 || |
| 2339 | EVP_CIPHER_CTX_ctrl(NULL, 0, 0, NULL) == 0); |
Damien Miller | d522c68 | 2013-01-09 16:42:47 +1100 | [diff] [blame] | 2340 | ]])], |
| 2341 | [ |
| 2342 | AC_MSG_RESULT([yes]) |
| 2343 | AC_DEFINE([OPENSSL_HAVE_EVPGCM], [1], |
| 2344 | [libcrypto has EVP AES GCM]) |
| 2345 | ], |
| 2346 | [ |
| 2347 | AC_MSG_RESULT([no]) |
| 2348 | ] |
| 2349 | ) |
| 2350 | |
Damien Miller | b6f73b3 | 2013-02-11 10:39:12 +1100 | [diff] [blame] | 2351 | AC_SEARCH_LIBS([EVP_CIPHER_CTX_ctrl], [crypto], |
| 2352 | [AC_DEFINE([HAVE_EVP_CIPHER_CTX_CTRL], [1], |
| 2353 | [Define if libcrypto has EVP_CIPHER_CTX_ctrl])]) |
| 2354 | |
Darren Tucker | 3e7e15f | 2009-03-07 22:22:35 +1100 | [diff] [blame] | 2355 | AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) |
| 2356 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2357 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 3e7e15f | 2009-03-07 22:22:35 +1100 | [diff] [blame] | 2358 | #include <string.h> |
| 2359 | #include <openssl/evp.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2360 | ]], [[ |
| 2361 | if(EVP_DigestUpdate(NULL, NULL,0)) |
| 2362 | exit(0); |
Darren Tucker | 3e7e15f | 2009-03-07 22:22:35 +1100 | [diff] [blame] | 2363 | ]])], |
| 2364 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2365 | AC_MSG_RESULT([yes]) |
Darren Tucker | 3e7e15f | 2009-03-07 22:22:35 +1100 | [diff] [blame] | 2366 | ], |
| 2367 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2368 | AC_MSG_RESULT([no]) |
| 2369 | AC_DEFINE([OPENSSL_EVP_DIGESTUPDATE_VOID], [1], |
Darren Tucker | 3e7e15f | 2009-03-07 22:22:35 +1100 | [diff] [blame] | 2370 | [Define if EVP_DigestUpdate returns void]) |
| 2371 | ] |
| 2372 | ) |
| 2373 | |
Tim Rice | 3d5352e | 2004-02-12 09:27:21 -0800 | [diff] [blame] | 2374 | # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, |
| 2375 | # because the system crypt() is more featureful. |
| 2376 | if test "x$check_for_libcrypt_before" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2377 | AC_CHECK_LIB([crypt], [crypt]) |
Tim Rice | 3d5352e | 2004-02-12 09:27:21 -0800 | [diff] [blame] | 2378 | fi |
| 2379 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2380 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
Tim Rice | 43fa557 | 2004-02-11 14:46:40 -0800 | [diff] [blame] | 2381 | # version in OpenSSL. |
Damien Miller | 4f9f42a | 2003-05-10 19:28:02 +1000 | [diff] [blame] | 2382 | if test "x$check_for_libcrypt_later" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2383 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 2384 | fi |
| 2385 | |
Damien Miller | af87af1 | 2006-03-15 13:02:28 +1100 | [diff] [blame] | 2386 | # Search for SHA256 support in libc and/or OpenSSL |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2387 | AC_CHECK_FUNCS([SHA256_Update EVP_sha256], [TEST_SSH_SHA256=yes], |
Darren Tucker | 50c61f8 | 2011-01-16 18:28:09 +1100 | [diff] [blame] | 2388 | [TEST_SSH_SHA256=no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2389 | AC_SUBST([TEST_SSH_SHA256]) |
Damien Miller | af87af1 | 2006-03-15 13:02:28 +1100 | [diff] [blame] | 2390 | |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2391 | # Check complete ECC support in OpenSSL |
| 2392 | AC_MSG_CHECKING([whether OpenSSL has complete ECC support]) |
| 2393 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2394 | [AC_LANG_PROGRAM([[ |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2395 | #include <openssl/ec.h> |
Damien Miller | e323ebc | 2011-01-19 23:12:27 +1100 | [diff] [blame] | 2396 | #include <openssl/ecdh.h> |
| 2397 | #include <openssl/ecdsa.h> |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2398 | #include <openssl/evp.h> |
| 2399 | #include <openssl/objects.h> |
Damien Miller | e323ebc | 2011-01-19 23:12:27 +1100 | [diff] [blame] | 2400 | #include <openssl/opensslv.h> |
| 2401 | #if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */ |
| 2402 | # error "OpenSSL < 0.9.8g has unreliable ECC code" |
| 2403 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2404 | ]], [[ |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2405 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2406 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2407 | ]])], |
| 2408 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2409 | AC_MSG_RESULT([yes]) |
| 2410 | AC_DEFINE([OPENSSL_HAS_ECC], [1], |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2411 | [libcrypto includes complete ECC support]) |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 2412 | TEST_SSH_ECC=yes |
Tim Rice | 9b87a5c | 2011-01-12 22:35:43 -0800 | [diff] [blame] | 2413 | COMMENT_OUT_ECC="" |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2414 | ], |
| 2415 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2416 | AC_MSG_RESULT([no]) |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 2417 | TEST_SSH_ECC=no |
Tim Rice | 9b87a5c | 2011-01-12 22:35:43 -0800 | [diff] [blame] | 2418 | COMMENT_OUT_ECC="#no ecc#" |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2419 | ] |
| 2420 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2421 | AC_SUBST([TEST_SSH_ECC]) |
| 2422 | AC_SUBST([COMMENT_OUT_ECC]) |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2423 | |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2424 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2425 | AC_CHECK_LIB([iaf], [ia_openinfo], [ |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2426 | LIBS="$LIBS -liaf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2427 | AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf" |
| 2428 | AC_DEFINE([HAVE_LIBIAF], [1], |
Tim Rice | 0eeaf12 | 2007-09-10 16:24:17 -0700 | [diff] [blame] | 2429 | [Define if system has libiaf that supports set_id]) |
| 2430 | ]) |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2431 | ]) |
| 2432 | LIBS="$saved_LIBS" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2433 | |
| 2434 | ### Configure cryptographic random number support |
| 2435 | |
| 2436 | # Check wheter OpenSSL seeds itself |
| 2437 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2438 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2439 | [AC_LANG_PROGRAM([[ |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2440 | #include <string.h> |
| 2441 | #include <openssl/rand.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2442 | ]], [[ |
| 2443 | exit(RAND_status() == 1 ? 0 : 1); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2444 | ]])], |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2445 | [ |
| 2446 | OPENSSL_SEEDS_ITSELF=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2447 | AC_MSG_RESULT([yes]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2448 | ], |
| 2449 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2450 | AC_MSG_RESULT([no]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2451 | ], |
| 2452 | [ |
| 2453 | AC_MSG_WARN([cross compiling: assuming yes]) |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 2454 | # This is safe, since we will fatal() at runtime if |
| 2455 | # OpenSSL is not seeded correctly. |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2456 | OPENSSL_SEEDS_ITSELF=yes |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2457 | ] |
| 2458 | ) |
| 2459 | |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 2460 | # PRNGD TCP socket |
| 2461 | AC_ARG_WITH([prngd-port], |
| 2462 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 2463 | [ |
| 2464 | case "$withval" in |
| 2465 | no) |
| 2466 | withval="" |
| 2467 | ;; |
| 2468 | [[0-9]]*) |
| 2469 | ;; |
| 2470 | *) |
| 2471 | AC_MSG_ERROR([You must specify a numeric port number for --with-prngd-port]) |
| 2472 | ;; |
| 2473 | esac |
| 2474 | if test ! -z "$withval" ; then |
| 2475 | PRNGD_PORT="$withval" |
| 2476 | AC_DEFINE_UNQUOTED([PRNGD_PORT], [$PRNGD_PORT], |
| 2477 | [Port number of PRNGD/EGD random number socket]) |
| 2478 | fi |
| 2479 | ] |
| 2480 | ) |
| 2481 | |
| 2482 | # PRNGD Unix domain socket |
| 2483 | AC_ARG_WITH([prngd-socket], |
| 2484 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 2485 | [ |
| 2486 | case "$withval" in |
| 2487 | yes) |
| 2488 | withval="/var/run/egd-pool" |
| 2489 | ;; |
| 2490 | no) |
| 2491 | withval="" |
| 2492 | ;; |
| 2493 | /*) |
| 2494 | ;; |
| 2495 | *) |
| 2496 | AC_MSG_ERROR([You must specify an absolute path to the entropy socket]) |
| 2497 | ;; |
| 2498 | esac |
| 2499 | |
| 2500 | if test ! -z "$withval" ; then |
| 2501 | if test ! -z "$PRNGD_PORT" ; then |
| 2502 | AC_MSG_ERROR([You may not specify both a PRNGD/EGD port and socket]) |
| 2503 | fi |
| 2504 | if test ! -r "$withval" ; then |
| 2505 | AC_MSG_WARN([Entropy socket is not readable]) |
| 2506 | fi |
| 2507 | PRNGD_SOCKET="$withval" |
| 2508 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"], |
| 2509 | [Location of PRNGD/EGD random number socket]) |
| 2510 | fi |
| 2511 | ], |
| 2512 | [ |
| 2513 | # Check for existing socket only if we don't have a random device already |
| 2514 | if test "x$OPENSSL_SEEDS_ITSELF" != "xyes" ; then |
| 2515 | AC_MSG_CHECKING([for PRNGD/EGD socket]) |
| 2516 | # Insert other locations here |
| 2517 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 2518 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 2519 | PRNGD_SOCKET="$sock" |
| 2520 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"]) |
| 2521 | break; |
| 2522 | fi |
| 2523 | done |
| 2524 | if test ! -z "$PRNGD_SOCKET" ; then |
| 2525 | AC_MSG_RESULT([$PRNGD_SOCKET]) |
| 2526 | else |
| 2527 | AC_MSG_RESULT([not found]) |
| 2528 | fi |
| 2529 | fi |
| 2530 | ] |
| 2531 | ) |
| 2532 | |
| 2533 | # Which randomness source do we use? |
| 2534 | if test ! -z "$PRNGD_PORT" ; then |
| 2535 | RAND_MSG="PRNGd port $PRNGD_PORT" |
| 2536 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 2537 | RAND_MSG="PRNGd socket $PRNGD_SOCKET" |
| 2538 | elif test ! -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 2539 | AC_DEFINE([OPENSSL_PRNG_ONLY], [1], |
| 2540 | [Define if you want OpenSSL's internally seeded PRNG only]) |
| 2541 | RAND_MSG="OpenSSL internal ONLY" |
| 2542 | else |
| 2543 | 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]) |
| 2544 | fi |
| 2545 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2546 | # Check for PAM libs |
| 2547 | PAM_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2548 | AC_ARG_WITH([pam], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2549 | [ --with-pam Enable PAM support ], |
| 2550 | [ |
| 2551 | if test "x$withval" != "xno" ; then |
| 2552 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ |
| 2553 | test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then |
| 2554 | AC_MSG_ERROR([PAM headers not found]) |
| 2555 | fi |
| 2556 | |
| 2557 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2558 | AC_CHECK_LIB([dl], [dlopen], , ) |
| 2559 | AC_CHECK_LIB([pam], [pam_set_item], , [AC_MSG_ERROR([*** libpam missing])]) |
| 2560 | AC_CHECK_FUNCS([pam_getenvlist]) |
| 2561 | AC_CHECK_FUNCS([pam_putenv]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2562 | LIBS="$saved_LIBS" |
| 2563 | |
| 2564 | PAM_MSG="yes" |
| 2565 | |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 2566 | SSHDLIBS="$SSHDLIBS -lpam" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2567 | AC_DEFINE([USE_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2568 | [Define if you want to enable PAM support]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2569 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2570 | if test $ac_cv_lib_dl_dlopen = yes; then |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2571 | case "$LIBS" in |
| 2572 | *-ldl*) |
| 2573 | # libdl already in LIBS |
| 2574 | ;; |
| 2575 | *) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 2576 | SSHDLIBS="$SSHDLIBS -ldl" |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2577 | ;; |
| 2578 | esac |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2579 | fi |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2580 | fi |
| 2581 | ] |
| 2582 | ) |
| 2583 | |
| 2584 | # Check for older PAM |
| 2585 | if test "x$PAM_MSG" = "xyes" ; then |
| 2586 | # Check PAM strerror arguments (old PAM) |
| 2587 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2588 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2589 | #include <stdlib.h> |
| 2590 | #if defined(HAVE_SECURITY_PAM_APPL_H) |
| 2591 | #include <security/pam_appl.h> |
| 2592 | #elif defined (HAVE_PAM_PAM_APPL_H) |
| 2593 | #include <pam/pam_appl.h> |
| 2594 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2595 | ]], [[ |
| 2596 | (void)pam_strerror((pam_handle_t *)NULL, -1); |
| 2597 | ]])], [AC_MSG_RESULT([no])], [ |
| 2598 | AC_DEFINE([HAVE_OLD_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2599 | [Define if you have an old version of PAM |
| 2600 | which takes only one argument to pam_strerror]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2601 | AC_MSG_RESULT([yes]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2602 | PAM_MSG="yes (old library)" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2603 | |
| 2604 | ]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2605 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2606 | |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 2607 | SSH_PRIVSEP_USER=sshd |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2608 | AC_ARG_WITH([privsep-user], |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 2609 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2610 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 2611 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 2612 | test "x${withval}" != "xyes"; then |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 2613 | SSH_PRIVSEP_USER=$withval |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2614 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2615 | ] |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2616 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2617 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], ["$SSH_PRIVSEP_USER"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2618 | [non-privileged user for privilege separation]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2619 | AC_SUBST([SSH_PRIVSEP_USER]) |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2620 | |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 2621 | if test "x$have_linux_no_new_privs" = "x1" ; then |
| 2622 | AC_CHECK_DECL([SECCOMP_MODE_FILTER], [have_seccomp_filter=1], , [ |
| 2623 | #include <sys/types.h> |
| 2624 | #include <linux/seccomp.h> |
| 2625 | ]) |
| 2626 | fi |
| 2627 | if test "x$have_seccomp_filter" = "x1" ; then |
| 2628 | AC_MSG_CHECKING([kernel for seccomp_filter support]) |
| 2629 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2630 | #include <errno.h> |
| 2631 | #include <elf.h> |
| 2632 | #include <linux/audit.h> |
| 2633 | #include <linux/seccomp.h> |
| 2634 | #include <stdlib.h> |
| 2635 | #include <sys/prctl.h> |
| 2636 | ]], |
| 2637 | [[ int i = $seccomp_audit_arch; |
| 2638 | errno = 0; |
| 2639 | prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0); |
| 2640 | exit(errno == EFAULT ? 0 : 1); ]])], |
| 2641 | [ AC_MSG_RESULT([yes]) ], [ |
| 2642 | AC_MSG_RESULT([no]) |
| 2643 | # Disable seccomp filter as a target |
| 2644 | have_seccomp_filter=0 |
| 2645 | ] |
| 2646 | ) |
| 2647 | fi |
| 2648 | |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 2649 | # Decide which sandbox style to use |
| 2650 | sandbox_arg="" |
| 2651 | AC_ARG_WITH([sandbox], |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 2652 | [ --with-sandbox=style Specify privilege separation sandbox (no, darwin, rlimit, systrace, seccomp_filter)], |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 2653 | [ |
| 2654 | if test "x$withval" = "xyes" ; then |
| 2655 | sandbox_arg="" |
| 2656 | else |
| 2657 | sandbox_arg="$withval" |
| 2658 | fi |
| 2659 | ] |
| 2660 | ) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 2661 | |
| 2662 | # Some platforms (seems to be the ones that have a kernel poll(2)-type |
| 2663 | # function with which they implement select(2)) use an extra file descriptor |
| 2664 | # when calling select(2), which means we can't use the rlimit sandbox. |
| 2665 | AC_MSG_CHECKING([if select works with descriptor rlimit]) |
| 2666 | AC_RUN_IFELSE( |
| 2667 | [AC_LANG_PROGRAM([[ |
| 2668 | #include <sys/types.h> |
| 2669 | #ifdef HAVE_SYS_TIME_H |
| 2670 | # include <sys/time.h> |
| 2671 | #endif |
| 2672 | #include <sys/resource.h> |
| 2673 | #ifdef HAVE_SYS_SELECT_H |
| 2674 | # include <sys/select.h> |
| 2675 | #endif |
| 2676 | #include <errno.h> |
| 2677 | #include <fcntl.h> |
| 2678 | #include <stdlib.h> |
| 2679 | ]],[[ |
| 2680 | struct rlimit rl_zero; |
| 2681 | int fd, r; |
| 2682 | fd_set fds; |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 2683 | struct timeval tv; |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 2684 | |
| 2685 | fd = open("/dev/null", O_RDONLY); |
| 2686 | FD_ZERO(&fds); |
| 2687 | FD_SET(fd, &fds); |
| 2688 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 2689 | setrlimit(RLIMIT_FSIZE, &rl_zero); |
| 2690 | setrlimit(RLIMIT_NOFILE, &rl_zero); |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 2691 | tv.tv_sec = 1; |
| 2692 | tv.tv_usec = 0; |
| 2693 | r = select(fd+1, &fds, NULL, NULL, &tv); |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 2694 | exit (r == -1 ? 1 : 0); |
| 2695 | ]])], |
| 2696 | [AC_MSG_RESULT([yes]) |
| 2697 | select_works_with_rlimit=yes], |
| 2698 | [AC_MSG_RESULT([no]) |
| 2699 | select_works_with_rlimit=no], |
| 2700 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 2701 | ) |
| 2702 | |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 2703 | AC_MSG_CHECKING([if setrlimit(RLIMIT_NOFILE,{0,0}) works]) |
| 2704 | AC_RUN_IFELSE( |
| 2705 | [AC_LANG_PROGRAM([[ |
| 2706 | #include <sys/types.h> |
| 2707 | #ifdef HAVE_SYS_TIME_H |
| 2708 | # include <sys/time.h> |
| 2709 | #endif |
| 2710 | #include <sys/resource.h> |
| 2711 | #include <errno.h> |
| 2712 | #include <stdlib.h> |
| 2713 | ]],[[ |
| 2714 | struct rlimit rl_zero; |
| 2715 | int fd, r; |
| 2716 | fd_set fds; |
| 2717 | |
| 2718 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 2719 | r = setrlimit(RLIMIT_NOFILE, &rl_zero); |
| 2720 | exit (r == -1 ? 1 : 0); |
| 2721 | ]])], |
| 2722 | [AC_MSG_RESULT([yes]) |
| 2723 | rlimit_nofile_zero_works=yes], |
| 2724 | [AC_MSG_RESULT([no]) |
| 2725 | rlimit_nofile_zero_works=no], |
| 2726 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 2727 | ) |
| 2728 | |
Darren Tucker | d545a4b | 2012-07-03 22:48:31 +1000 | [diff] [blame] | 2729 | AC_MSG_CHECKING([if setrlimit RLIMIT_FSIZE works]) |
| 2730 | AC_RUN_IFELSE( |
| 2731 | [AC_LANG_PROGRAM([[ |
| 2732 | #include <sys/types.h> |
| 2733 | #include <sys/resource.h> |
| 2734 | #include <stdlib.h> |
| 2735 | ]],[[ |
| 2736 | struct rlimit rl_zero; |
| 2737 | |
| 2738 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 2739 | exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0); |
| 2740 | ]])], |
| 2741 | [AC_MSG_RESULT([yes])], |
| 2742 | [AC_MSG_RESULT([no]) |
| 2743 | AC_DEFINE(SANDBOX_SKIP_RLIMIT_FSIZE, 1, |
| 2744 | [setrlimit RLIMIT_FSIZE works])], |
| 2745 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 2746 | ) |
| 2747 | |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 2748 | if test "x$sandbox_arg" = "xsystrace" || \ |
| 2749 | ( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 2750 | test "x$have_systr_policy_kill" != "x1" && \ |
| 2751 | 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] | 2752 | SANDBOX_STYLE="systrace" |
| 2753 | AC_DEFINE([SANDBOX_SYSTRACE], [1], [Sandbox using systrace(4)]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 2754 | elif test "x$sandbox_arg" = "xdarwin" || \ |
| 2755 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \ |
| 2756 | test "x$ac_cv_header_sandbox_h" = "xyes") ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 2757 | test "x$ac_cv_func_sandbox_init" != "xyes" -o \ |
| 2758 | "x$ac_cv_header_sandbox_h" != "xyes" && \ |
| 2759 | 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] | 2760 | SANDBOX_STYLE="darwin" |
| 2761 | AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 2762 | elif test "x$sandbox_arg" = "xseccomp_filter" || \ |
| 2763 | ( test -z "$sandbox_arg" && \ |
Darren Tucker | d0494fd | 2012-05-19 14:25:39 +1000 | [diff] [blame] | 2764 | test "x$have_seccomp_filter" = "x1" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 2765 | test "x$ac_cv_header_elf_h" = "xyes" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 2766 | test "x$ac_cv_header_linux_audit_h" = "xyes" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 2767 | test "x$ac_cv_header_linux_filter_h" = "xyes" && \ |
| 2768 | test "x$seccomp_audit_arch" != "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 2769 | test "x$have_linux_no_new_privs" = "x1" && \ |
| 2770 | test "x$ac_cv_func_prctl" = "xyes" ) ; then |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 2771 | test "x$seccomp_audit_arch" = "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 2772 | AC_MSG_ERROR([seccomp_filter sandbox not supported on $host]) |
| 2773 | test "x$have_linux_no_new_privs" != "x1" && \ |
| 2774 | AC_MSG_ERROR([seccomp_filter sandbox requires PR_SET_NO_NEW_PRIVS]) |
| 2775 | test "x$have_seccomp_filter" != "x1" && \ |
| 2776 | AC_MSG_ERROR([seccomp_filter sandbox requires seccomp headers]) |
| 2777 | test "x$ac_cv_func_prctl" != "xyes" && \ |
| 2778 | AC_MSG_ERROR([seccomp_filter sandbox requires prctl function]) |
| 2779 | SANDBOX_STYLE="seccomp_filter" |
| 2780 | AC_DEFINE([SANDBOX_SECCOMP_FILTER], [1], [Sandbox using seccomp filter]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 2781 | elif test "x$sandbox_arg" = "xrlimit" || \ |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 2782 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" && \ |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 2783 | test "x$select_works_with_rlimit" = "xyes" && \ |
| 2784 | test "x$rlimit_nofile_zero_works" = "xyes" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 2785 | test "x$ac_cv_func_setrlimit" != "xyes" && \ |
| 2786 | AC_MSG_ERROR([rlimit sandbox requires setrlimit function]) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 2787 | test "x$select_works_with_rlimit" != "xyes" && \ |
| 2788 | AC_MSG_ERROR([rlimit sandbox requires select to work with rlimit]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 2789 | SANDBOX_STYLE="rlimit" |
| 2790 | AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)]) |
| 2791 | elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \ |
| 2792 | test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then |
| 2793 | SANDBOX_STYLE="none" |
| 2794 | AC_DEFINE([SANDBOX_NULL], [1], [no privsep sandboxing]) |
| 2795 | else |
Tim Rice | a6e6061 | 2011-08-17 21:48:22 -0700 | [diff] [blame] | 2796 | AC_MSG_ERROR([unsupported --with-sandbox]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 2797 | fi |
| 2798 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 2799 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 2800 | if test ! -z "$SONY" ; then |
| 2801 | LIBS="$LIBS -liberty"; |
| 2802 | fi |
| 2803 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2804 | # Check for long long datatypes |
| 2805 | AC_CHECK_TYPES([long long, unsigned long long, long double]) |
| 2806 | |
| 2807 | # Check datatype sizes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2808 | AC_CHECK_SIZEOF([short int], [2]) |
| 2809 | AC_CHECK_SIZEOF([int], [4]) |
| 2810 | AC_CHECK_SIZEOF([long int], [4]) |
| 2811 | AC_CHECK_SIZEOF([long long int], [8]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 2812 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 2813 | # Sanity check long long for some platforms (AIX) |
| 2814 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 2815 | ac_cv_sizeof_long_long_int=0 |
| 2816 | fi |
| 2817 | |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2818 | # compute LLONG_MIN and LLONG_MAX if we don't know them. |
| 2819 | if test -z "$have_llong_max"; then |
| 2820 | AC_MSG_CHECKING([for max value of long long]) |
| 2821 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2822 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2823 | #include <stdio.h> |
| 2824 | /* Why is this so damn hard? */ |
| 2825 | #ifdef __GNUC__ |
| 2826 | # undef __GNUC__ |
| 2827 | #endif |
| 2828 | #define __USE_ISOC99 |
| 2829 | #include <limits.h> |
| 2830 | #define DATA "conftest.llminmax" |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 2831 | #define my_abs(a) ((a) < 0 ? ((a) * -1) : (a)) |
| 2832 | |
| 2833 | /* |
| 2834 | * printf in libc on some platforms (eg old Tru64) does not understand %lld so |
| 2835 | * we do this the hard way. |
| 2836 | */ |
| 2837 | static int |
| 2838 | fprint_ll(FILE *f, long long n) |
| 2839 | { |
| 2840 | unsigned int i; |
| 2841 | int l[sizeof(long long) * 8]; |
| 2842 | |
| 2843 | if (n < 0) |
| 2844 | if (fprintf(f, "-") < 0) |
| 2845 | return -1; |
| 2846 | for (i = 0; n != 0; i++) { |
| 2847 | l[i] = my_abs(n % 10); |
| 2848 | n /= 10; |
| 2849 | } |
| 2850 | do { |
| 2851 | if (fprintf(f, "%d", l[--i]) < 0) |
| 2852 | return -1; |
| 2853 | } while (i != 0); |
| 2854 | if (fprintf(f, " ") < 0) |
| 2855 | return -1; |
| 2856 | return 0; |
| 2857 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2858 | ]], [[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2859 | FILE *f; |
| 2860 | long long i, llmin, llmax = 0; |
| 2861 | |
| 2862 | if((f = fopen(DATA,"w")) == NULL) |
| 2863 | exit(1); |
| 2864 | |
| 2865 | #if defined(LLONG_MIN) && defined(LLONG_MAX) |
| 2866 | fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); |
| 2867 | llmin = LLONG_MIN; |
| 2868 | llmax = LLONG_MAX; |
| 2869 | #else |
| 2870 | fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); |
| 2871 | /* This will work on one's complement and two's complement */ |
| 2872 | for (i = 1; i > llmax; i <<= 1, i++) |
| 2873 | llmax = i; |
| 2874 | llmin = llmax + 1LL; /* wrap */ |
| 2875 | #endif |
| 2876 | |
| 2877 | /* Sanity check */ |
| 2878 | if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 2879 | || llmax - 1 > llmax || llmin == llmax || llmin == 0 |
| 2880 | || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) { |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2881 | fprintf(f, "unknown unknown\n"); |
| 2882 | exit(2); |
| 2883 | } |
| 2884 | |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 2885 | if (fprint_ll(f, llmin) < 0) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2886 | exit(3); |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 2887 | if (fprint_ll(f, llmax) < 0) |
| 2888 | exit(4); |
| 2889 | if (fclose(f) < 0) |
| 2890 | exit(5); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2891 | exit(0); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2892 | ]])], |
| 2893 | [ |
| 2894 | llong_min=`$AWK '{print $1}' conftest.llminmax` |
| 2895 | llong_max=`$AWK '{print $2}' conftest.llminmax` |
| 2896 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2897 | AC_MSG_RESULT([$llong_max]) |
| 2898 | AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2899 | [max value of long long calculated by configure]) |
| 2900 | AC_MSG_CHECKING([for min value of long long]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2901 | AC_MSG_RESULT([$llong_min]) |
| 2902 | AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2903 | [min value of long long calculated by configure]) |
| 2904 | ], |
| 2905 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2906 | AC_MSG_RESULT([not found]) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2907 | ], |
| 2908 | [ |
| 2909 | AC_MSG_WARN([cross compiling: not checking]) |
| 2910 | ] |
| 2911 | ) |
| 2912 | fi |
| 2913 | |
| 2914 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2915 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 2916 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2917 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 2918 | [[ u_int a; a = 1;]])], |
| 2919 | [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no" |
| 2920 | ]) |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 2921 | ]) |
| 2922 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2923 | 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] | 2924 | have_u_int=1 |
| 2925 | fi |
| 2926 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2927 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2928 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 2929 | [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])], |
| 2930 | [ ac_cv_have_intxx_t="yes" ], [ ac_cv_have_intxx_t="no" |
| 2931 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2932 | ]) |
| 2933 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2934 | 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] | 2935 | have_intxx_t=1 |
| 2936 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2937 | |
| 2938 | if (test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2939 | test "x$ac_cv_header_stdint_h" = "xyes") |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2940 | then |
| 2941 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2942 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 2943 | [[ 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] | 2944 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2945 | AC_DEFINE([HAVE_INTXX_T]) |
| 2946 | AC_MSG_RESULT([yes]) |
| 2947 | ], [ AC_MSG_RESULT([no]) |
| 2948 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2949 | fi |
| 2950 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2951 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2952 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | 907881e | 2002-07-18 11:44:50 -0700 | [diff] [blame] | 2953 | #include <sys/types.h> |
| 2954 | #ifdef HAVE_STDINT_H |
| 2955 | # include <stdint.h> |
| 2956 | #endif |
| 2957 | #include <sys/socket.h> |
| 2958 | #ifdef HAVE_SYS_BITYPES_H |
| 2959 | # include <sys/bitypes.h> |
| 2960 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2961 | ]], [[ |
| 2962 | int64_t a; a = 1; |
| 2963 | ]])], |
| 2964 | [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no" |
| 2965 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2966 | ]) |
| 2967 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2968 | 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] | 2969 | fi |
| 2970 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2971 | 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] | 2972 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 2973 | [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])], |
| 2974 | [ ac_cv_have_u_intxx_t="yes" ], [ ac_cv_have_u_intxx_t="no" |
| 2975 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2976 | ]) |
| 2977 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2978 | 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] | 2979 | have_u_intxx_t=1 |
| 2980 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 2981 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2982 | if test -z "$have_u_intxx_t" ; then |
| 2983 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2984 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]], |
| 2985 | [[ 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] | 2986 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2987 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 2988 | AC_MSG_RESULT([yes]) |
| 2989 | ], [ AC_MSG_RESULT([no]) |
| 2990 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2991 | fi |
| 2992 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2993 | 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] | 2994 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 2995 | [[ u_int64_t a; a = 1;]])], |
| 2996 | [ ac_cv_have_u_int64_t="yes" ], [ ac_cv_have_u_int64_t="no" |
| 2997 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2998 | ]) |
| 2999 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3000 | 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] | 3001 | have_u_int64_t=1 |
| 3002 | fi |
| 3003 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3004 | if test -z "$have_u_int64_t" ; then |
| 3005 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3006 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]], |
| 3007 | [[ u_int64_t a; a = 1]])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3008 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3009 | AC_DEFINE([HAVE_U_INT64_T]) |
| 3010 | AC_MSG_RESULT([yes]) |
| 3011 | ], [ AC_MSG_RESULT([no]) |
| 3012 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3013 | fi |
| 3014 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3015 | if test -z "$have_u_intxx_t" ; then |
| 3016 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3017 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3018 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3019 | ]], [[ |
| 3020 | uint8_t a; |
| 3021 | uint16_t b; |
| 3022 | uint32_t c; |
| 3023 | a = b = c = 1; |
| 3024 | ]])], |
| 3025 | [ ac_cv_have_uintxx_t="yes" ], [ ac_cv_have_uintxx_t="no" |
| 3026 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3027 | ]) |
| 3028 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3029 | AC_DEFINE([HAVE_UINTXX_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3030 | [define if you have uintxx_t data type]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3031 | fi |
| 3032 | fi |
| 3033 | |
| 3034 | if test -z "$have_uintxx_t" ; then |
| 3035 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3036 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3037 | [[ 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] | 3038 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3039 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3040 | AC_MSG_RESULT([yes]) |
| 3041 | ], [ AC_MSG_RESULT([no]) |
| 3042 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3043 | fi |
| 3044 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 3045 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3046 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3047 | then |
| 3048 | 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] | 3049 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3050 | #include <sys/bitypes.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3051 | ]], [[ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 3052 | int8_t a; int16_t b; int32_t c; |
| 3053 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 3054 | a = b = c = e = f = g = 1; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3055 | ]])], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3056 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3057 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3058 | AC_DEFINE([HAVE_INTXX_T]) |
| 3059 | AC_MSG_RESULT([yes]) |
| 3060 | ], [AC_MSG_RESULT([no]) |
| 3061 | ]) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3062 | fi |
| 3063 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3064 | |
| 3065 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3066 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3067 | [[ u_char foo; foo = 125; ]])], |
| 3068 | [ ac_cv_have_u_char="yes" ], [ ac_cv_have_u_char="no" |
| 3069 | ]) |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3070 | ]) |
| 3071 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3072 | 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] | 3073 | fi |
| 3074 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3075 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 3076 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3077 | AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>]) |
| 3078 | AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 3079 | #include <sys/types.h> |
| 3080 | #ifdef HAVE_SYS_BITYPES_H |
| 3081 | #include <sys/bitypes.h> |
| 3082 | #endif |
| 3083 | #ifdef HAVE_SYS_STATFS_H |
| 3084 | #include <sys/statfs.h> |
| 3085 | #endif |
| 3086 | #ifdef HAVE_SYS_STATVFS_H |
| 3087 | #include <sys/statvfs.h> |
| 3088 | #endif |
| 3089 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3090 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3091 | AC_CHECK_TYPES([in_addr_t, in_port_t], , , |
Damien Miller | 848b993 | 2005-02-24 12:12:34 +1100 | [diff] [blame] | 3092 | [#include <sys/types.h> |
| 3093 | #include <netinet/in.h>]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 3094 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3095 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3096 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3097 | [[ size_t foo; foo = 1235; ]])], |
| 3098 | [ ac_cv_have_size_t="yes" ], [ ac_cv_have_size_t="no" |
| 3099 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3100 | ]) |
| 3101 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3102 | 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] | 3103 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 3104 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3105 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3106 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3107 | [[ ssize_t foo; foo = 1235; ]])], |
| 3108 | [ ac_cv_have_ssize_t="yes" ], [ ac_cv_have_ssize_t="no" |
| 3109 | ]) |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3110 | ]) |
| 3111 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3112 | 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] | 3113 | fi |
| 3114 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3115 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3116 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <time.h> ]], |
| 3117 | [[ clock_t foo; foo = 1235; ]])], |
| 3118 | [ ac_cv_have_clock_t="yes" ], [ ac_cv_have_clock_t="no" |
| 3119 | ]) |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3120 | ]) |
| 3121 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3122 | 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] | 3123 | fi |
| 3124 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3125 | 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] | 3126 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3127 | #include <sys/types.h> |
| 3128 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3129 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
| 3130 | [ ac_cv_have_sa_family_t="yes" ], |
| 3131 | [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3132 | #include <sys/types.h> |
| 3133 | #include <sys/socket.h> |
| 3134 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3135 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3136 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3137 | [ ac_cv_have_sa_family_t="no" ] |
| 3138 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3139 | ]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3140 | ]) |
| 3141 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3142 | AC_DEFINE([HAVE_SA_FAMILY_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3143 | [define if you have sa_family_t data type]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3144 | fi |
| 3145 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3146 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3147 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3148 | [[ pid_t foo; foo = 1235; ]])], |
| 3149 | [ ac_cv_have_pid_t="yes" ], [ ac_cv_have_pid_t="no" |
| 3150 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3151 | ]) |
| 3152 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3153 | 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] | 3154 | fi |
| 3155 | |
| 3156 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3157 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3158 | [[ mode_t foo; foo = 1235; ]])], |
| 3159 | [ ac_cv_have_mode_t="yes" ], [ ac_cv_have_mode_t="no" |
| 3160 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3161 | ]) |
| 3162 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3163 | 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] | 3164 | fi |
| 3165 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3166 | |
| 3167 | 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] | 3168 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3169 | #include <sys/types.h> |
| 3170 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3171 | ]], [[ struct sockaddr_storage s; ]])], |
| 3172 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 3173 | [ ac_cv_have_struct_sockaddr_storage="no" |
| 3174 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3175 | ]) |
| 3176 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3177 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3178 | [define if you have struct sockaddr_storage data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3179 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3180 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3181 | 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] | 3182 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3183 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3184 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3185 | ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])], |
| 3186 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 3187 | [ ac_cv_have_struct_sockaddr_in6="no" |
| 3188 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3189 | ]) |
| 3190 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3191 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_IN6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3192 | [define if you have struct sockaddr_in6 data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3193 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3194 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3195 | 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] | 3196 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3197 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3198 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3199 | ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])], |
| 3200 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 3201 | [ ac_cv_have_struct_in6_addr="no" |
| 3202 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3203 | ]) |
| 3204 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3205 | AC_DEFINE([HAVE_STRUCT_IN6_ADDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3206 | [define if you have struct in6_addr data type]) |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3207 | |
| 3208 | dnl Now check for sin6_scope_id |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3209 | AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , , |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3210 | [ |
| 3211 | #ifdef HAVE_SYS_TYPES_H |
| 3212 | #include <sys/types.h> |
| 3213 | #endif |
| 3214 | #include <netinet/in.h> |
| 3215 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3216 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3217 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3218 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3219 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3220 | #include <sys/types.h> |
| 3221 | #include <sys/socket.h> |
| 3222 | #include <netdb.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3223 | ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])], |
| 3224 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 3225 | [ ac_cv_have_struct_addrinfo="no" |
| 3226 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3227 | ]) |
| 3228 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3229 | AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3230 | [define if you have struct addrinfo data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3231 | fi |
| 3232 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3233 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3234 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], |
| 3235 | [[ struct timeval tv; tv.tv_sec = 1;]])], |
| 3236 | [ ac_cv_have_struct_timeval="yes" ], |
| 3237 | [ ac_cv_have_struct_timeval="no" |
| 3238 | ]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3239 | ]) |
| 3240 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3241 | AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3242 | have_struct_timeval=1 |
| 3243 | fi |
| 3244 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3245 | AC_CHECK_TYPES([struct timespec]) |
Tim Rice | 4e4dc56 | 2003-03-18 10:21:40 -0800 | [diff] [blame] | 3246 | |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3247 | # 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] | 3248 | if test "x$ac_cv_have_int64_t" = "xno" && \ |
| 3249 | test "x$ac_cv_sizeof_long_int" != "x8" && \ |
| 3250 | test "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3251 | echo "OpenSSH requires int64_t support. Contact your vendor or install" |
| 3252 | echo "an alternative compiler (I.E., GCC) before continuing." |
| 3253 | echo "" |
| 3254 | exit 1; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3255 | else |
| 3256 | dnl test snprintf (broken on SCO w/gcc) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3257 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3258 | [AC_LANG_SOURCE([[ |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3259 | #include <stdio.h> |
| 3260 | #include <string.h> |
| 3261 | #ifdef HAVE_SNPRINTF |
| 3262 | main() |
| 3263 | { |
| 3264 | char buf[50]; |
| 3265 | char expected_out[50]; |
| 3266 | int mazsize = 50 ; |
| 3267 | #if (SIZEOF_LONG_INT == 8) |
| 3268 | long int num = 0x7fffffffffffffff; |
| 3269 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 3270 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3271 | #endif |
| 3272 | strcpy(expected_out, "9223372036854775807"); |
| 3273 | snprintf(buf, mazsize, "%lld", num); |
| 3274 | if(strcmp(buf, expected_out) != 0) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3275 | exit(1); |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3276 | exit(0); |
| 3277 | } |
| 3278 | #else |
| 3279 | main() { exit(0); } |
| 3280 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3281 | ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3282 | AC_MSG_WARN([cross compiling: Assuming working snprintf()]) |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3283 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 3284 | fi |
| 3285 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3286 | dnl Checks for structure members |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3287 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmp.h], [HAVE_HOST_IN_UTMP]) |
| 3288 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmpx.h], [HAVE_HOST_IN_UTMPX]) |
| 3289 | OSSH_CHECK_HEADER_FOR_FIELD([syslen], [utmpx.h], [HAVE_SYSLEN_IN_UTMPX]) |
| 3290 | OSSH_CHECK_HEADER_FOR_FIELD([ut_pid], [utmp.h], [HAVE_PID_IN_UTMP]) |
| 3291 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmp.h], [HAVE_TYPE_IN_UTMP]) |
| 3292 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmpx.h], [HAVE_TYPE_IN_UTMPX]) |
| 3293 | OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmp.h], [HAVE_TV_IN_UTMP]) |
| 3294 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmp.h], [HAVE_ID_IN_UTMP]) |
| 3295 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmpx.h], [HAVE_ID_IN_UTMPX]) |
| 3296 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP]) |
| 3297 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX]) |
| 3298 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP]) |
| 3299 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX]) |
| 3300 | OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP]) |
| 3301 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP]) |
| 3302 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX]) |
| 3303 | 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] | 3304 | |
| 3305 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3306 | AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, |
| 3307 | struct passwd.pw_change, struct passwd.pw_expire], |
| 3308 | [], [], [[ |
| 3309 | #include <sys/types.h> |
| 3310 | #include <pwd.h> |
| 3311 | ]]) |
| 3312 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3313 | AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state], |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3314 | [Define if we don't have struct __res_state in resolv.h])], |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3315 | [[ |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3316 | #include <stdio.h> |
| 3317 | #if HAVE_SYS_TYPES_H |
| 3318 | # include <sys/types.h> |
| 3319 | #endif |
| 3320 | #include <netinet/in.h> |
| 3321 | #include <arpa/nameser.h> |
| 3322 | #include <resolv.h> |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3323 | ]]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3324 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3325 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 3326 | ac_cv_have_ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3327 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3328 | #include <sys/types.h> |
| 3329 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3330 | ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])], |
| 3331 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 3332 | [ ac_cv_have_ss_family_in_struct_ss="no" ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3333 | ]) |
| 3334 | 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] | 3335 | 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] | 3336 | fi |
| 3337 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3338 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 3339 | ac_cv_have___ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3340 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3341 | #include <sys/types.h> |
| 3342 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3343 | ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])], |
| 3344 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 3345 | [ ac_cv_have___ss_family_in_struct_ss="no" |
| 3346 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3347 | ]) |
| 3348 | 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] | 3349 | AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3350 | [Fields in struct sockaddr_storage]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3351 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 3352 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3353 | 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] | 3354 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 3355 | ac_cv_have_accrights_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3356 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3357 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3358 | #include <sys/socket.h> |
| 3359 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3360 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3361 | #ifdef msg_accrights |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3362 | #error "msg_accrights is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3363 | exit(1); |
| 3364 | #endif |
| 3365 | struct msghdr m; |
| 3366 | m.msg_accrights = 0; |
| 3367 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3368 | ]])], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3369 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 3370 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 3371 | ) |
| 3372 | ]) |
| 3373 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3374 | AC_DEFINE([HAVE_ACCRIGHTS_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3375 | [Define if your system uses access rights style |
| 3376 | file descriptor passing]) |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3377 | fi |
| 3378 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3379 | AC_MSG_CHECKING([if struct statvfs.f_fsid is integral type]) |
| 3380 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e1a3ddf | 2012-05-04 11:05:45 +1000 | [diff] [blame] | 3381 | #include <sys/param.h> |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3382 | #include <sys/stat.h> |
| 3383 | #ifdef HAVE_SYS_TIME_H |
| 3384 | # include <sys/time.h> |
| 3385 | #endif |
| 3386 | #ifdef HAVE_SYS_MOUNT_H |
| 3387 | #include <sys/mount.h> |
| 3388 | #endif |
| 3389 | #ifdef HAVE_SYS_STATVFS_H |
| 3390 | #include <sys/statvfs.h> |
| 3391 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3392 | ]], [[ struct statvfs s; s.f_fsid = 0; ]])], |
| 3393 | [ AC_MSG_RESULT([yes]) ], |
| 3394 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3395 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3396 | AC_MSG_CHECKING([if fsid_t has member val]) |
| 3397 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3398 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3399 | #include <sys/statvfs.h> |
| 3400 | ]], [[ fsid_t t; t.val[0] = 0; ]])], |
| 3401 | [ AC_MSG_RESULT([yes]) |
| 3402 | AC_DEFINE([FSID_HAS_VAL], [1], [fsid_t has member val]) ], |
| 3403 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3404 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3405 | AC_MSG_CHECKING([if f_fsid has member __val]) |
| 3406 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3407 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3408 | #include <sys/statvfs.h> |
| 3409 | ]], [[ fsid_t t; t.__val[0] = 0; ]])], |
| 3410 | [ AC_MSG_RESULT([yes]) |
| 3411 | AC_DEFINE([FSID_HAS___VAL], [1], [fsid_t has member __val]) ], |
| 3412 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3413 | ]) |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 3414 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3415 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 3416 | ac_cv_have_control_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3417 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3418 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3419 | #include <sys/socket.h> |
| 3420 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3421 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3422 | #ifdef msg_control |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3423 | #error "msg_control is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3424 | exit(1); |
| 3425 | #endif |
| 3426 | struct msghdr m; |
| 3427 | m.msg_control = 0; |
| 3428 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3429 | ]])], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3430 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 3431 | [ ac_cv_have_control_in_msghdr="no" ] |
| 3432 | ) |
| 3433 | ]) |
| 3434 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3435 | AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3436 | [Define if your system uses ancillary data style |
| 3437 | file descriptor passing]) |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3438 | fi |
| 3439 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3440 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3441 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 3442 | [[ extern char *__progname; printf("%s", __progname); ]])], |
| 3443 | [ ac_cv_libc_defines___progname="yes" ], |
| 3444 | [ ac_cv_libc_defines___progname="no" |
| 3445 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3446 | ]) |
| 3447 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3448 | AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3449 | fi |
| 3450 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3451 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3452 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 3453 | [[ printf("%s", __FUNCTION__); ]])], |
| 3454 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
| 3455 | [ ac_cv_cc_implements___FUNCTION__="no" |
| 3456 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3457 | ]) |
| 3458 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3459 | AC_DEFINE([HAVE___FUNCTION__], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3460 | [Define if compiler implements __FUNCTION__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3461 | fi |
| 3462 | |
| 3463 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3464 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 3465 | [[ printf("%s", __func__); ]])], |
| 3466 | [ ac_cv_cc_implements___func__="yes" ], |
| 3467 | [ ac_cv_cc_implements___func__="no" |
| 3468 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3469 | ]) |
| 3470 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3471 | AC_DEFINE([HAVE___func__], [1], [Define if compiler implements __func__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3472 | fi |
| 3473 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3474 | AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3475 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3476 | #include <stdarg.h> |
| 3477 | va_list x,y; |
| 3478 | ]], [[ va_copy(x,y); ]])], |
| 3479 | [ ac_cv_have_va_copy="yes" ], |
| 3480 | [ ac_cv_have_va_copy="no" |
| 3481 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3482 | ]) |
| 3483 | if test "x$ac_cv_have_va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3484 | AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3485 | fi |
| 3486 | |
| 3487 | AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3488 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3489 | #include <stdarg.h> |
| 3490 | va_list x,y; |
| 3491 | ]], [[ __va_copy(x,y); ]])], |
| 3492 | [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no" |
| 3493 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3494 | ]) |
| 3495 | if test "x$ac_cv_have___va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3496 | AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3497 | fi |
| 3498 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 3499 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 3500 | ac_cv_have_getopt_optreset, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3501 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <getopt.h> ]], |
| 3502 | [[ extern int optreset; optreset = 0; ]])], |
| 3503 | [ ac_cv_have_getopt_optreset="yes" ], |
| 3504 | [ ac_cv_have_getopt_optreset="no" |
| 3505 | ]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 3506 | ]) |
| 3507 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3508 | AC_DEFINE([HAVE_GETOPT_OPTRESET], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3509 | [Define if your getopt(3) defines and uses optreset]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 3510 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3511 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 3512 | 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] | 3513 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 3514 | [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])], |
| 3515 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
| 3516 | [ ac_cv_libc_defines_sys_errlist="no" |
| 3517 | ]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 3518 | ]) |
| 3519 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3520 | AC_DEFINE([HAVE_SYS_ERRLIST], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3521 | [Define if your system defines sys_errlist[]]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 3522 | fi |
| 3523 | |
| 3524 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 3525 | 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] | 3526 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 3527 | [[ extern int sys_nerr; printf("%i", sys_nerr);]])], |
| 3528 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
| 3529 | [ ac_cv_libc_defines_sys_nerr="no" |
| 3530 | ]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 3531 | ]) |
| 3532 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3533 | 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] | 3534 | fi |
| 3535 | |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3536 | # Check libraries needed by DNS fingerprint support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3537 | AC_SEARCH_LIBS([getrrsetbyname], [resolv], |
| 3538 | [AC_DEFINE([HAVE_GETRRSETBYNAME], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3539 | [Define if getrrsetbyname() exists])], |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 3540 | [ |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3541 | # Needed by our getrrsetbyname() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3542 | AC_SEARCH_LIBS([res_query], [resolv]) |
| 3543 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
| 3544 | AC_MSG_CHECKING([if res_query will link]) |
| 3545 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 3546 | #include <sys/types.h> |
| 3547 | #include <netinet/in.h> |
| 3548 | #include <arpa/nameser.h> |
| 3549 | #include <netdb.h> |
| 3550 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3551 | ]], [[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 3552 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3553 | ]])], |
| 3554 | AC_MSG_RESULT([yes]), |
| 3555 | [AC_MSG_RESULT([no]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3556 | saved_LIBS="$LIBS" |
| 3557 | LIBS="$LIBS -lresolv" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3558 | AC_MSG_CHECKING([for res_query in -lresolv]) |
| 3559 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 3560 | #include <sys/types.h> |
| 3561 | #include <netinet/in.h> |
| 3562 | #include <arpa/nameser.h> |
| 3563 | #include <netdb.h> |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3564 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3565 | ]], [[ |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3566 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3567 | ]])], |
| 3568 | [AC_MSG_RESULT([yes])], |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3569 | [LIBS="$saved_LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3570 | AC_MSG_RESULT([no])]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3571 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3572 | AC_CHECK_FUNCS([_getshort _getlong]) |
Darren Tucker | d886e1c | 2005-06-01 18:57:45 +1000 | [diff] [blame] | 3573 | AC_CHECK_DECLS([_getshort, _getlong], , , |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 3574 | [#include <sys/types.h> |
| 3575 | #include <arpa/nameser.h>]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3576 | AC_CHECK_MEMBER([HEADER.ad], |
| 3577 | [AC_DEFINE([HAVE_HEADER_AD], [1], |
| 3578 | [Define if HEADER.ad exists in arpa/nameser.h])], , |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3579 | [#include <arpa/nameser.h>]) |
| 3580 | ]) |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 3581 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3582 | AC_MSG_CHECKING([if struct __res_state _res is an extern]) |
| 3583 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 3584 | #include <stdio.h> |
| 3585 | #if HAVE_SYS_TYPES_H |
| 3586 | # include <sys/types.h> |
| 3587 | #endif |
| 3588 | #include <netinet/in.h> |
| 3589 | #include <arpa/nameser.h> |
| 3590 | #include <resolv.h> |
| 3591 | extern struct __res_state _res; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3592 | ]], [[ ]])], |
| 3593 | [AC_MSG_RESULT([yes]) |
| 3594 | AC_DEFINE([HAVE__RES_EXTERN], [1], |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 3595 | [Define if you have struct __res_state _res as an extern]) |
| 3596 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3597 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 3598 | ) |
| 3599 | |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3600 | # Check whether user wants SELinux support |
| 3601 | SELINUX_MSG="no" |
| 3602 | LIBSELINUX="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3603 | AC_ARG_WITH([selinux], |
Damien Miller | 5b1c8b3 | 2008-03-27 12:33:07 +1100 | [diff] [blame] | 3604 | [ --with-selinux Enable SELinux support], |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3605 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3606 | save_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3607 | AC_DEFINE([WITH_SELINUX], [1], |
| 3608 | [Define if you want SELinux support.]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3609 | SELINUX_MSG="yes" |
| 3610 | AC_CHECK_HEADER([selinux/selinux.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3611 | AC_MSG_ERROR([SELinux support requires selinux.h header])) |
| 3612 | AC_CHECK_LIB([selinux], [setexeccon], |
Damien Miller | 1d2bfc4 | 2010-02-10 10:19:29 +1100 | [diff] [blame] | 3613 | [ LIBSELINUX="-lselinux" |
| 3614 | LIBS="$LIBS -lselinux" |
| 3615 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3616 | AC_MSG_ERROR([SELinux support requires libselinux library])) |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 3617 | SSHLIBS="$SSHLIBS $LIBSELINUX" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3618 | SSHDLIBS="$SSHDLIBS $LIBSELINUX" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3619 | AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level]) |
Darren Tucker | adc947d | 2006-10-07 09:07:20 +1000 | [diff] [blame] | 3620 | LIBS="$save_LIBS" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3621 | fi ] |
| 3622 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3623 | AC_SUBST([SSHLIBS]) |
| 3624 | AC_SUBST([SSHDLIBS]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3625 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 3626 | # Check whether user wants Kerberos 5 support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3627 | KRB5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3628 | AC_ARG_WITH([kerberos5], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3629 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3630 | [ if test "x$withval" != "xno" ; then |
| 3631 | if test "x$withval" = "xyes" ; then |
| 3632 | KRB5ROOT="/usr/local" |
| 3633 | else |
| 3634 | KRB5ROOT=${withval} |
| 3635 | fi |
| 3636 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3637 | AC_DEFINE([KRB5], [1], [Define if you want Kerberos 5 support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3638 | KRB5_MSG="yes" |
| 3639 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3640 | AC_PATH_PROG([KRB5CONF], [krb5-config], |
Darren Tucker | dad48e7 | 2009-09-01 18:26:00 +1000 | [diff] [blame] | 3641 | [$KRB5ROOT/bin/krb5-config], |
| 3642 | [$KRB5ROOT/bin:$PATH]) |
| 3643 | if test -x $KRB5CONF ; then |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 3644 | K5CFLAGS="`$KRB5CONF --cflags`" |
| 3645 | K5LIBS="`$KRB5CONF --libs`" |
| 3646 | CPPFLAGS="$CPPFLAGS $K5CFLAGS" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3647 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3648 | AC_MSG_CHECKING([for gssapi support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3649 | if $KRB5CONF | grep gssapi >/dev/null ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3650 | AC_MSG_RESULT([yes]) |
| 3651 | AC_DEFINE([GSSAPI], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3652 | [Define this if you want GSSAPI |
| 3653 | support in the version 2 protocol]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 3654 | GSSCFLAGS="`$KRB5CONF --cflags gssapi`" |
| 3655 | GSSLIBS="`$KRB5CONF --libs gssapi`" |
| 3656 | CPPFLAGS="$CPPFLAGS $GSSCFLAGS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3657 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3658 | AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3659 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3660 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 3661 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 3662 | ]], [[ char *tmp = heimdal_version; ]])], |
| 3663 | [ AC_MSG_RESULT([yes]) |
| 3664 | AC_DEFINE([HEIMDAL], [1], |
| 3665 | [Define this if you are using the Heimdal |
| 3666 | version of Kerberos V5]) ], |
| 3667 | [AC_MSG_RESULT([no]) |
| 3668 | ]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3669 | else |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 3670 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3671 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3672 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 3673 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 3674 | ]], [[ char *tmp = heimdal_version; ]])], |
| 3675 | [ AC_MSG_RESULT([yes]) |
| 3676 | AC_DEFINE([HEIMDAL]) |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 3677 | K5LIBS="-lkrb5" |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 3678 | K5LIBS="$K5LIBS -lcom_err -lasn1" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3679 | AC_CHECK_LIB([roken], [net_write], |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 3680 | [K5LIBS="$K5LIBS -lroken"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3681 | AC_CHECK_LIB([des], [des_cbc_encrypt], |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 3682 | [K5LIBS="$K5LIBS -ldes"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3683 | ], [ AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3684 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3685 | |
| 3686 | ]) |
| 3687 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 3688 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3689 | AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context], |
| 3690 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 3691 | GSSLIBS="-lgssapi_krb5" ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3692 | [ AC_CHECK_LIB([gssapi], [gss_init_sec_context], |
| 3693 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 3694 | GSSLIBS="-lgssapi" ], |
Darren Tucker | a2b5a4c | 2013-02-22 10:43:15 +1100 | [diff] [blame] | 3695 | [ AC_CHECK_LIB([gss], [gss_init_sec_context], |
| 3696 | [ AC_DEFINE([GSSAPI]) |
| 3697 | GSSLIBS="-lgss" ], |
| 3698 | AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail])) |
| 3699 | ]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 3700 | ]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3701 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3702 | AC_CHECK_HEADER([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 3703 | [ unset ac_cv_header_gssapi_h |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3704 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3705 | AC_CHECK_HEADERS([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 3706 | 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] | 3707 | ) |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 3708 | ] |
| 3709 | ) |
| 3710 | |
| 3711 | oldCPP="$CPPFLAGS" |
| 3712 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3713 | AC_CHECK_HEADER([gssapi_krb5.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 3714 | [ CPPFLAGS="$oldCPP" ]) |
| 3715 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3716 | fi |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3717 | if test ! -z "$need_dash_r" ; then |
| 3718 | LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" |
| 3719 | fi |
| 3720 | if test ! -z "$blibpath" ; then |
| 3721 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 3722 | fi |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 3723 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3724 | AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h]) |
| 3725 | AC_CHECK_HEADERS([gssapi_krb5.h gssapi/gssapi_krb5.h]) |
| 3726 | AC_CHECK_HEADERS([gssapi_generic.h gssapi/gssapi_generic.h]) |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 3727 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3728 | AC_SEARCH_LIBS([k_hasafs], [kafs], [AC_DEFINE([USE_AFS], [1], |
| 3729 | [Define this if you want to use libkafs' AFS support])]) |
Darren Tucker | 03978c6 | 2013-02-25 11:24:44 +1100 | [diff] [blame] | 3730 | |
| 3731 | AC_CHECK_DECLS([GSS_C_NT_HOSTBASED_SERVICE], [], [], [[ |
| 3732 | #ifdef HAVE_GSSAPI_H |
| 3733 | # include <gssapi.h> |
| 3734 | #elif defined(HAVE_GSSAPI_GSSAPI_H) |
| 3735 | # include <gssapi/gssapi.h> |
| 3736 | #endif |
| 3737 | |
| 3738 | #ifdef HAVE_GSSAPI_GENERIC_H |
| 3739 | # include <gssapi_generic.h> |
| 3740 | #elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H) |
| 3741 | # include <gssapi/gssapi_generic.h> |
| 3742 | #endif |
| 3743 | ]]) |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 3744 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 3745 | ] |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 3746 | ) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 3747 | AC_SUBST([GSSLIBS]) |
| 3748 | AC_SUBST([K5LIBS]) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 3749 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3750 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3751 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3752 | PRIVSEP_PATH=/var/empty |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3753 | AC_ARG_WITH([privsep-path], |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 3754 | [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3755 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3756 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3757 | test "x${withval}" != "xyes"; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3758 | PRIVSEP_PATH=$withval |
| 3759 | fi |
| 3760 | ] |
| 3761 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3762 | AC_SUBST([PRIVSEP_PATH]) |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3763 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3764 | AC_ARG_WITH([xauth], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3765 | [ --with-xauth=PATH Specify path to xauth program ], |
| 3766 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3767 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3768 | test "x${withval}" != "xyes"; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3769 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3770 | fi |
| 3771 | ], |
| 3772 | [ |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 3773 | TestPath="$PATH" |
| 3774 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" |
| 3775 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" |
| 3776 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" |
| 3777 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3778 | AC_PATH_PROG([xauth_path], [xauth], , [$TestPath]) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 3779 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3780 | xauth_path="/usr/openwin/bin/xauth" |
| 3781 | fi |
| 3782 | ] |
| 3783 | ) |
| 3784 | |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 3785 | STRIP_OPT=-s |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3786 | AC_ARG_ENABLE([strip], |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 3787 | [ --disable-strip Disable calling strip(1) on install], |
| 3788 | [ |
| 3789 | if test "x$enableval" = "xno" ; then |
| 3790 | STRIP_OPT= |
| 3791 | fi |
| 3792 | ] |
| 3793 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3794 | AC_SUBST([STRIP_OPT]) |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 3795 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 3796 | if test -z "$xauth_path" ; then |
| 3797 | XAUTH_PATH="undefined" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3798 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 3799 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3800 | AC_DEFINE_UNQUOTED([XAUTH_PATH], ["$xauth_path"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3801 | [Define if xauth is found in your path]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 3802 | XAUTH_PATH=$xauth_path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3803 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3804 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3805 | |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 3806 | dnl # --with-maildir=/path/to/mail gets top priority. |
| 3807 | dnl # if maildir is set in the platform case statement above we use that. |
| 3808 | dnl # Otherwise we run a program to get the dir from system headers. |
| 3809 | dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL |
| 3810 | dnl # If we find _PATH_MAILDIR we do nothing because that is what |
| 3811 | dnl # session.c expects anyway. Otherwise we set to the value found |
| 3812 | dnl # stripping any trailing slash. If for some strage reason our program |
| 3813 | dnl # does not find what it needs, we default to /var/spool/mail. |
| 3814 | # Check for mail directory |
| 3815 | AC_ARG_WITH([maildir], |
| 3816 | [ --with-maildir=/path/to/mail Specify your system mail directory], |
| 3817 | [ |
| 3818 | if test "X$withval" != X && test "x$withval" != xno && \ |
| 3819 | test "x${withval}" != xyes; then |
| 3820 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"], |
| 3821 | [Set this to your mail directory if you do not have _PATH_MAILDIR]) |
| 3822 | fi |
| 3823 | ],[ |
| 3824 | if test "X$maildir" != "X"; then |
| 3825 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 3826 | else |
| 3827 | AC_MSG_CHECKING([Discovering system mail directory]) |
| 3828 | AC_RUN_IFELSE( |
| 3829 | [AC_LANG_PROGRAM([[ |
| 3830 | #include <stdio.h> |
| 3831 | #include <string.h> |
| 3832 | #ifdef HAVE_PATHS_H |
| 3833 | #include <paths.h> |
| 3834 | #endif |
| 3835 | #ifdef HAVE_MAILLOCK_H |
| 3836 | #include <maillock.h> |
| 3837 | #endif |
| 3838 | #define DATA "conftest.maildir" |
| 3839 | ]], [[ |
| 3840 | FILE *fd; |
| 3841 | int rc; |
| 3842 | |
| 3843 | fd = fopen(DATA,"w"); |
| 3844 | if(fd == NULL) |
| 3845 | exit(1); |
| 3846 | |
| 3847 | #if defined (_PATH_MAILDIR) |
| 3848 | if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0) |
| 3849 | exit(1); |
| 3850 | #elif defined (MAILDIR) |
| 3851 | if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0) |
| 3852 | exit(1); |
| 3853 | #elif defined (_PATH_MAIL) |
| 3854 | if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0) |
| 3855 | exit(1); |
| 3856 | #else |
| 3857 | exit (2); |
| 3858 | #endif |
| 3859 | |
| 3860 | exit(0); |
| 3861 | ]])], |
| 3862 | [ |
| 3863 | maildir_what=`awk -F: '{print $1}' conftest.maildir` |
| 3864 | maildir=`awk -F: '{print $2}' conftest.maildir \ |
| 3865 | | sed 's|/$||'` |
| 3866 | AC_MSG_RESULT([Using: $maildir from $maildir_what]) |
| 3867 | if test "x$maildir_what" != "x_PATH_MAILDIR"; then |
| 3868 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 3869 | fi |
| 3870 | ], |
| 3871 | [ |
| 3872 | if test "X$ac_status" = "X2";then |
| 3873 | # our test program didn't find it. Default to /var/spool/mail |
| 3874 | AC_MSG_RESULT([Using: default value of /var/spool/mail]) |
| 3875 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"]) |
| 3876 | else |
| 3877 | AC_MSG_RESULT([*** not found ***]) |
| 3878 | fi |
| 3879 | ], |
| 3880 | [ |
| 3881 | AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail]) |
| 3882 | ] |
| 3883 | ) |
| 3884 | fi |
| 3885 | ] |
| 3886 | ) # maildir |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3887 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3888 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3889 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) |
| 3890 | disable_ptmx_check=yes |
| 3891 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3892 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 3893 | if test "x$disable_ptmx_check" != "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3894 | AC_CHECK_FILE(["/dev/ptmx"], |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 3895 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3896 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTMX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3897 | [Define if you have /dev/ptmx]) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 3898 | have_dev_ptmx=1 |
| 3899 | ] |
| 3900 | ) |
| 3901 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3902 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3903 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3904 | if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3905 | AC_CHECK_FILE(["/dev/ptc"], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3906 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3907 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTS_AND_PTC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3908 | [Define if you have /dev/ptc]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3909 | have_dev_ptc=1 |
| 3910 | ] |
| 3911 | ) |
| 3912 | else |
| 3913 | AC_MSG_WARN([cross compiling: Disabling /dev/ptc test]) |
| 3914 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 3915 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3916 | # Options from here on. Some of these are preset by platform above |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3917 | AC_ARG_WITH([mantype], |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 3918 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 3919 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 3920 | case "$withval" in |
| 3921 | man|cat|doc) |
| 3922 | MANTYPE=$withval |
| 3923 | ;; |
| 3924 | *) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3925 | AC_MSG_ERROR([invalid man type: $withval]) |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 3926 | ;; |
| 3927 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 3928 | ] |
| 3929 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 3930 | if test -z "$MANTYPE"; then |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 3931 | TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3932 | AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 3933 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 3934 | MANTYPE=doc |
| 3935 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 3936 | MANTYPE=man |
| 3937 | else |
| 3938 | MANTYPE=cat |
| 3939 | fi |
| 3940 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3941 | AC_SUBST([MANTYPE]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 3942 | if test "$MANTYPE" = "doc"; then |
| 3943 | mansubdir=man; |
| 3944 | else |
| 3945 | mansubdir=$MANTYPE; |
| 3946 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3947 | AC_SUBST([mansubdir]) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 3948 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3949 | # Check whether to enable MD5 passwords |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3950 | MD5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3951 | AC_ARG_WITH([md5-passwords], |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 3952 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 3953 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 3954 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3955 | AC_DEFINE([HAVE_MD5_PASSWORDS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3956 | [Define if you want to allow MD5 passwords]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3957 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 3958 | fi |
| 3959 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 3960 | ) |
| 3961 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3962 | # Whether to disable shadow password support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3963 | AC_ARG_WITH([shadow], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 3964 | [ --without-shadow Disable shadow password support], |
| 3965 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3966 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3967 | AC_DEFINE([DISABLE_SHADOW]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 3968 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 3969 | fi |
| 3970 | ] |
| 3971 | ) |
| 3972 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 3973 | if test -z "$disable_shadow" ; then |
| 3974 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3975 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 3976 | #include <sys/types.h> |
| 3977 | #include <shadow.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3978 | struct spwd sp; |
| 3979 | ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])], |
| 3980 | [ sp_expire_available=yes ], [ |
| 3981 | ]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 3982 | |
| 3983 | if test "x$sp_expire_available" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3984 | AC_MSG_RESULT([yes]) |
| 3985 | AC_DEFINE([HAS_SHADOW_EXPIRE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3986 | [Define if you want to use shadow password expire field]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 3987 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3988 | AC_MSG_RESULT([no]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 3989 | fi |
| 3990 | fi |
| 3991 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3992 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 3993 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 3994 | DISPLAY_HACK_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3995 | AC_DEFINE([IPADDR_IN_DISPLAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3996 | [Define if you need to use IP address |
| 3997 | instead of hostname in $DISPLAY]) |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 3998 | else |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3999 | DISPLAY_HACK_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4000 | AC_ARG_WITH([ipaddr-display], |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4001 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 4002 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4003 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4004 | AC_DEFINE([IPADDR_IN_DISPLAY]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4005 | DISPLAY_HACK_MSG="yes" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4006 | fi |
| 4007 | ] |
| 4008 | ) |
| 4009 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4010 | |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4011 | # check for /etc/default/login and use it if present. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4012 | AC_ARG_ENABLE([etc-default-login], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 4013 | [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4014 | [ if test "x$enableval" = "xno"; then |
| 4015 | AC_MSG_NOTICE([/etc/default/login handling disabled]) |
| 4016 | etc_default_login=no |
| 4017 | else |
| 4018 | etc_default_login=yes |
| 4019 | fi ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4020 | [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; |
| 4021 | then |
| 4022 | AC_MSG_WARN([cross compiling: not checking /etc/default/login]) |
| 4023 | etc_default_login=no |
| 4024 | else |
| 4025 | etc_default_login=yes |
| 4026 | fi ] |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4027 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4028 | |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4029 | if test "x$etc_default_login" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4030 | AC_CHECK_FILE(["/etc/default/login"], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4031 | [ external_path_file=/etc/default/login ]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4032 | if test "x$external_path_file" = "x/etc/default/login"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4033 | AC_DEFINE([HAVE_ETC_DEFAULT_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4034 | [Define if your system has /etc/default/login]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4035 | fi |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4036 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4037 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4038 | 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] | 4039 | if test $ac_cv_func_login_getcapbool = "yes" && \ |
| 4040 | test $ac_cv_header_login_cap_h = "yes" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4041 | external_path_file=/etc/login.conf |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4042 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4043 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4044 | # Whether to mess with the default path |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4045 | SERVER_PATH_MSG="(default)" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4046 | AC_ARG_WITH([default-path], |
Damien Miller | f71d2a5 | 2002-05-13 15:14:08 +1000 | [diff] [blame] | 4047 | [ --with-default-path= Specify default \$PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4048 | [ |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4049 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4050 | AC_MSG_WARN([ |
| 4051 | --with-default-path=PATH has no effect on this system. |
| 4052 | Edit /etc/login.conf instead.]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4053 | elif test "x$withval" != "xno" ; then |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4054 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4055 | AC_MSG_WARN([ |
| 4056 | --with-default-path=PATH will only be used if PATH is not defined in |
| 4057 | $external_path_file .]) |
| 4058 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4059 | user_path="$withval" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4060 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4061 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4062 | ], |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4063 | [ if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 4064 | 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] | 4065 | else |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4066 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4067 | AC_MSG_WARN([ |
| 4068 | If PATH is defined in $external_path_file, ensure the path to scp is included, |
| 4069 | otherwise scp will not work.]) |
| 4070 | fi |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4071 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4072 | [AC_LANG_PROGRAM([[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4073 | /* find out what STDPATH is */ |
| 4074 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4075 | #ifdef HAVE_PATHS_H |
| 4076 | # include <paths.h> |
| 4077 | #endif |
| 4078 | #ifndef _PATH_STDPATH |
Tim Rice | 1c9e688 | 2002-11-22 13:29:01 -0800 | [diff] [blame] | 4079 | # ifdef _PATH_USERPATH /* Irix */ |
| 4080 | # define _PATH_STDPATH _PATH_USERPATH |
| 4081 | # else |
| 4082 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 4083 | # endif |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4084 | #endif |
| 4085 | #include <sys/types.h> |
| 4086 | #include <sys/stat.h> |
| 4087 | #include <fcntl.h> |
| 4088 | #define DATA "conftest.stdpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4089 | ]], [[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4090 | FILE *fd; |
| 4091 | int rc; |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4092 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4093 | fd = fopen(DATA,"w"); |
| 4094 | if(fd == NULL) |
| 4095 | exit(1); |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4096 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4097 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 4098 | exit(1); |
| 4099 | |
| 4100 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4101 | ]])], |
| 4102 | [ user_path=`cat conftest.stdpath` ], |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4103 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 4104 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 4105 | ) |
| 4106 | # make sure $bindir is in USER_PATH so scp will work |
Damien Miller | 77eab7b | 2012-07-06 11:49:28 +1000 | [diff] [blame] | 4107 | t_bindir="${bindir}" |
| 4108 | while echo "${t_bindir}" | egrep '\$\{|NONE/' >/dev/null 2>&1; do |
| 4109 | t_bindir=`eval echo ${t_bindir}` |
| 4110 | case $t_bindir in |
| 4111 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 4112 | esac |
| 4113 | case $t_bindir in |
| 4114 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 4115 | esac |
| 4116 | done |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4117 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 4118 | if test $? -ne 0 ; then |
| 4119 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 4120 | if test $? -ne 0 ; then |
| 4121 | user_path=$user_path:$t_bindir |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4122 | 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] | 4123 | fi |
| 4124 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4125 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4126 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4127 | if test "x$external_path_file" != "x/etc/login.conf" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4128 | AC_DEFINE_UNQUOTED([USER_PATH], ["$user_path"], [Specify default $PATH]) |
| 4129 | AC_SUBST([user_path]) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4130 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4131 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4132 | # Set superuser path separately to user path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4133 | AC_ARG_WITH([superuser-path], |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4134 | [ --with-superuser-path= Specify different path for super-user], |
| 4135 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4136 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4137 | test "x${withval}" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4138 | AC_DEFINE_UNQUOTED([SUPERUSER_PATH], ["$withval"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4139 | [Define if you want a different $PATH |
| 4140 | for the superuser]) |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4141 | superuser_path=$withval |
| 4142 | fi |
| 4143 | ] |
| 4144 | ) |
| 4145 | |
| 4146 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4147 | 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] | 4148 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4149 | AC_ARG_WITH(4in6, |
| 4150 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 4151 | [ |
| 4152 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4153 | AC_MSG_RESULT([yes]) |
| 4154 | AC_DEFINE([IPV4_IN_IPV6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4155 | [Detect IPv4 in IPv6 mapped addresses |
| 4156 | and treat as IPv4]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4157 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4158 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4159 | AC_MSG_RESULT([no]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4160 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4161 | ], [ |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4162 | if test "x$inet6_default_4in6" = "xyes"; then |
| 4163 | AC_MSG_RESULT([yes (default)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4164 | AC_DEFINE([IPV4_IN_IPV6]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4165 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4166 | else |
| 4167 | AC_MSG_RESULT([no (default)]) |
| 4168 | fi |
| 4169 | ] |
| 4170 | ) |
| 4171 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4172 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4173 | BSD_AUTH_MSG=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4174 | AC_ARG_WITH([bsd-auth], |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4175 | [ --with-bsd-auth Enable BSD auth support], |
| 4176 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4177 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4178 | AC_DEFINE([BSD_AUTH], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4179 | [Define if you have BSD auth support]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4180 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4181 | fi |
| 4182 | ] |
| 4183 | ) |
| 4184 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4185 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 4186 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4187 | # make sure the directory exists |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4188 | if test ! -d $piddir ; then |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4189 | piddir=`eval echo ${sysconfdir}` |
| 4190 | case $piddir in |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4191 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4192 | esac |
| 4193 | fi |
| 4194 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4195 | AC_ARG_WITH([pid-dir], |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4196 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 4197 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4198 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4199 | test "x${withval}" != "xyes"; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4200 | piddir=$withval |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4201 | if test ! -d $piddir ; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4202 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 4203 | fi |
| 4204 | fi |
| 4205 | ] |
| 4206 | ) |
| 4207 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4208 | AC_DEFINE_UNQUOTED([_PATH_SSH_PIDDIR], ["$piddir"], |
| 4209 | [Specify location of ssh.pid]) |
| 4210 | AC_SUBST([piddir]) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 4211 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4212 | dnl allow user to disable some login recording features |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4213 | AC_ARG_ENABLE([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4214 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4215 | [ |
| 4216 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4217 | AC_DEFINE([DISABLE_LASTLOG]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4218 | fi |
| 4219 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4220 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4221 | AC_ARG_ENABLE([utmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4222 | [ --disable-utmp disable use of utmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4223 | [ |
| 4224 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4225 | AC_DEFINE([DISABLE_UTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4226 | fi |
| 4227 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4228 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4229 | AC_ARG_ENABLE([utmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4230 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4231 | [ |
| 4232 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4233 | AC_DEFINE([DISABLE_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4234 | [Define if you don't want to use utmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4235 | fi |
| 4236 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4237 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4238 | AC_ARG_ENABLE([wtmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4239 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4240 | [ |
| 4241 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4242 | AC_DEFINE([DISABLE_WTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4243 | fi |
| 4244 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4245 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4246 | AC_ARG_ENABLE([wtmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4247 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4248 | [ |
| 4249 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4250 | AC_DEFINE([DISABLE_WTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4251 | [Define if you don't want to use wtmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4252 | fi |
| 4253 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4254 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4255 | AC_ARG_ENABLE([libutil], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4256 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4257 | [ |
| 4258 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4259 | AC_DEFINE([DISABLE_LOGIN]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4260 | fi |
| 4261 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4262 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4263 | AC_ARG_ENABLE([pututline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4264 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4265 | [ |
| 4266 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4267 | AC_DEFINE([DISABLE_PUTUTLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4268 | [Define if you don't want to use pututline() |
| 4269 | etc. to write [uw]tmp]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4270 | fi |
| 4271 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4272 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4273 | AC_ARG_ENABLE([pututxline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4274 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4275 | [ |
| 4276 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4277 | AC_DEFINE([DISABLE_PUTUTXLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4278 | [Define if you don't want to use pututxline() |
| 4279 | etc. to write [uw]tmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4280 | fi |
| 4281 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4282 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4283 | AC_ARG_WITH([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4284 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4285 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4286 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4287 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4288 | elif test -n "$withval" && test "x${withval}" != "xyes"; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4289 | conf_lastlog_location=$withval |
| 4290 | fi |
| 4291 | ] |
| 4292 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4293 | |
| 4294 | dnl lastlog, [uw]tmpx? detection |
| 4295 | dnl NOTE: set the paths in the platform section to avoid the |
| 4296 | dnl need for command-line parameters |
| 4297 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 4298 | |
| 4299 | dnl lastlog detection |
| 4300 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 4301 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4302 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4303 | #include <sys/types.h> |
| 4304 | #include <utmp.h> |
| 4305 | #ifdef HAVE_LASTLOG_H |
| 4306 | # include <lastlog.h> |
| 4307 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4308 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4309 | # include <paths.h> |
| 4310 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 4311 | #ifdef HAVE_LOGIN_H |
| 4312 | # include <login.h> |
| 4313 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4314 | ]], [[ char *lastlog = LASTLOG_FILE; ]])], |
| 4315 | [ AC_MSG_RESULT([yes]) ], |
| 4316 | [ |
| 4317 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4318 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4319 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4320 | #include <sys/types.h> |
| 4321 | #include <utmp.h> |
| 4322 | #ifdef HAVE_LASTLOG_H |
| 4323 | # include <lastlog.h> |
| 4324 | #endif |
| 4325 | #ifdef HAVE_PATHS_H |
| 4326 | # include <paths.h> |
| 4327 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4328 | ]], [[ char *lastlog = _PATH_LASTLOG; ]])], |
| 4329 | [ AC_MSG_RESULT([yes]) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4330 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4331 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4332 | system_lastlog_path=no |
| 4333 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4334 | ]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4335 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4336 | if test -z "$conf_lastlog_location"; then |
| 4337 | if test x"$system_lastlog_path" = x"no" ; then |
| 4338 | 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] | 4339 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4340 | conf_lastlog_location=$f |
| 4341 | fi |
| 4342 | done |
| 4343 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 4344 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 4345 | 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] | 4346 | fi |
| 4347 | fi |
| 4348 | fi |
| 4349 | |
| 4350 | if test -n "$conf_lastlog_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4351 | AC_DEFINE_UNQUOTED([CONF_LASTLOG_FILE], ["$conf_lastlog_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4352 | [Define if you want to specify the path to your lastlog file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4353 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4354 | |
| 4355 | dnl utmp detection |
| 4356 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4357 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4358 | #include <sys/types.h> |
| 4359 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4360 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4361 | # include <paths.h> |
| 4362 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4363 | ]], [[ char *utmp = UTMP_FILE; ]])], |
| 4364 | [ AC_MSG_RESULT([yes]) ], |
| 4365 | [ AC_MSG_RESULT([no]) |
| 4366 | system_utmp_path=no |
| 4367 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4368 | if test -z "$conf_utmp_location"; then |
| 4369 | if test x"$system_utmp_path" = x"no" ; then |
| 4370 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 4371 | if test -f $f ; then |
| 4372 | conf_utmp_location=$f |
| 4373 | fi |
| 4374 | done |
| 4375 | if test -z "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4376 | AC_DEFINE([DISABLE_UTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4377 | fi |
| 4378 | fi |
| 4379 | fi |
| 4380 | if test -n "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4381 | AC_DEFINE_UNQUOTED([CONF_UTMP_FILE], ["$conf_utmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4382 | [Define if you want to specify the path to your utmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4383 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4384 | |
| 4385 | dnl wtmp detection |
| 4386 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4387 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4388 | #include <sys/types.h> |
| 4389 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4390 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4391 | # include <paths.h> |
| 4392 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4393 | ]], [[ char *wtmp = WTMP_FILE; ]])], |
| 4394 | [ AC_MSG_RESULT([yes]) ], |
| 4395 | [ AC_MSG_RESULT([no]) |
| 4396 | system_wtmp_path=no |
| 4397 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4398 | if test -z "$conf_wtmp_location"; then |
| 4399 | if test x"$system_wtmp_path" = x"no" ; then |
| 4400 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 4401 | if test -f $f ; then |
| 4402 | conf_wtmp_location=$f |
| 4403 | fi |
| 4404 | done |
| 4405 | if test -z "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4406 | AC_DEFINE([DISABLE_WTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4407 | fi |
| 4408 | fi |
| 4409 | fi |
| 4410 | if test -n "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4411 | AC_DEFINE_UNQUOTED([CONF_WTMP_FILE], ["$conf_wtmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4412 | [Define if you want to specify the path to your wtmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4413 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4414 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4415 | dnl wtmpx detection |
| 4416 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4417 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4418 | #include <sys/types.h> |
| 4419 | #include <utmp.h> |
| 4420 | #ifdef HAVE_UTMPX_H |
| 4421 | #include <utmpx.h> |
| 4422 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4423 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4424 | # include <paths.h> |
| 4425 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4426 | ]], [[ char *wtmpx = WTMPX_FILE; ]])], |
| 4427 | [ AC_MSG_RESULT([yes]) ], |
| 4428 | [ AC_MSG_RESULT([no]) |
| 4429 | system_wtmpx_path=no |
| 4430 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4431 | if test -z "$conf_wtmpx_location"; then |
| 4432 | if test x"$system_wtmpx_path" = x"no" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4433 | AC_DEFINE([DISABLE_WTMPX]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4434 | fi |
| 4435 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4436 | AC_DEFINE_UNQUOTED([CONF_WTMPX_FILE], ["$conf_wtmpx_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4437 | [Define if you want to specify the path to your wtmpx file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4438 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4439 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 4440 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 4441 | if test ! -z "$blibpath" ; then |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 4442 | LDFLAGS="$LDFLAGS $blibflags$blibpath" |
| 4443 | AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 4444 | fi |
| 4445 | |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4446 | AC_CHECK_MEMBER([struct lastlog.ll_line], [], [ |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 4447 | if test x$SKIP_DISABLE_LASTLOG_DEFINE != "xyes" ; then |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4448 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 4449 | fi |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4450 | ], [ |
| 4451 | #ifdef HAVE_SYS_TYPES_H |
| 4452 | #include <sys/types.h> |
| 4453 | #endif |
| 4454 | #ifdef HAVE_UTMP_H |
| 4455 | #include <utmp.h> |
| 4456 | #endif |
| 4457 | #ifdef HAVE_UTMPX_H |
| 4458 | #include <utmpx.h> |
| 4459 | #endif |
| 4460 | #ifdef HAVE_LASTLOG_H |
| 4461 | #include <lastlog.h> |
| 4462 | #endif |
| 4463 | ]) |
| 4464 | |
| 4465 | AC_CHECK_MEMBER([struct utmp.ut_line], [], [ |
| 4466 | AC_DEFINE([DISABLE_UTMP]) |
| 4467 | AC_DEFINE([DISABLE_WTMP]) |
| 4468 | ], [ |
| 4469 | #ifdef HAVE_SYS_TYPES_H |
| 4470 | #include <sys/types.h> |
| 4471 | #endif |
| 4472 | #ifdef HAVE_UTMP_H |
| 4473 | #include <utmp.h> |
| 4474 | #endif |
| 4475 | #ifdef HAVE_UTMPX_H |
| 4476 | #include <utmpx.h> |
| 4477 | #endif |
| 4478 | #ifdef HAVE_LASTLOG_H |
| 4479 | #include <lastlog.h> |
| 4480 | #endif |
| 4481 | ]) |
| 4482 | |
Darren Tucker | 7da23cb | 2005-08-03 00:20:15 +1000 | [diff] [blame] | 4483 | dnl Adding -Werror to CFLAGS early prevents configure tests from running. |
| 4484 | dnl Add now. |
| 4485 | CFLAGS="$CFLAGS $werror_flags" |
| 4486 | |
Darren Tucker | 627337d | 2010-04-10 22:58:01 +1000 | [diff] [blame] | 4487 | if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then |
| 4488 | TEST_SSH_IPV6=no |
| 4489 | else |
| 4490 | TEST_SSH_IPV6=yes |
| 4491 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4492 | AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no]) |
| 4493 | AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6]) |
Darren Tucker | 5d37690 | 2008-06-11 04:15:05 +1000 | [diff] [blame] | 4494 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 4495 | AC_EXEEXT |
Damien Miller | 223897a | 2006-09-12 21:54:10 +1000 | [diff] [blame] | 4496 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
| 4497 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 4498 | survey.sh]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 4499 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 4500 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4501 | # Print summary of options |
| 4502 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4503 | # Someone please show me a better way :) |
| 4504 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 4505 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 4506 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 4507 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 4508 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4509 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4510 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4511 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 4512 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 4513 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4514 | |
| 4515 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 4516 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4517 | echo " User binaries: $B" |
| 4518 | echo " System binaries: $C" |
| 4519 | echo " Configuration files: $D" |
| 4520 | echo " Askpass program: $E" |
| 4521 | echo " Manual pages: $F" |
| 4522 | echo " PID file: $G" |
| 4523 | echo " Privilege separation chroot path: $H" |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4524 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 4525 | echo " At runtime, sshd will use the path defined in $external_path_file" |
| 4526 | 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] | 4527 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4528 | echo " sshd default user PATH: $I" |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4529 | if test ! -z "$external_path_file"; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4530 | echo " (If PATH is set in $external_path_file it will be used instead. If" |
| 4531 | echo " used, ensure the path to scp is present, otherwise scp will not work.)" |
| 4532 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4533 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4534 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4535 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4536 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4537 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4538 | echo " PAM support: $PAM_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 4539 | echo " OSF SIA support: $SIA_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4540 | echo " KerberosV support: $KRB5_MSG" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4541 | echo " SELinux support: $SELINUX_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4542 | echo " Smartcard support: $SCARD_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4543 | echo " S/KEY support: $SKEY_MSG" |
| 4544 | echo " TCP Wrappers support: $TCPW_MSG" |
| 4545 | echo " MD5 password support: $MD5_MSG" |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 4546 | echo " libedit support: $LIBEDIT_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 4547 | echo " Solaris process contract support: $SPC_MSG" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 4548 | echo " Solaris project support: $SP_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 4549 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4550 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 4551 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 4552 | echo " Random number source: $RAND_MSG" |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 4553 | echo " Privsep sandbox style: $SANDBOX_STYLE" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4554 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4555 | echo "" |
| 4556 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 4557 | echo " Host: ${host}" |
| 4558 | echo " Compiler: ${CC}" |
| 4559 | echo " Compiler flags: ${CFLAGS}" |
| 4560 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 4561 | echo " Linker flags: ${LDFLAGS}" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4562 | echo " Libraries: ${LIBS}" |
| 4563 | if test ! -z "${SSHDLIBS}"; then |
| 4564 | echo " +for sshd: ${SSHDLIBS}" |
| 4565 | fi |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 4566 | if test ! -z "${SSHLIBS}"; then |
| 4567 | echo " +for ssh: ${SSHLIBS}" |
| 4568 | fi |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4569 | |
| 4570 | echo "" |
| 4571 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 4572 | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then |
Darren Tucker | cf59d31 | 2004-08-29 21:18:09 +1000 | [diff] [blame] | 4573 | echo "SVR4 style packages are supported with \"make package\"" |
| 4574 | echo "" |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 4575 | fi |
| 4576 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 4577 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4578 | echo "PAM is enabled. You may need to install a PAM control file " |
| 4579 | echo "for sshd, otherwise password authentication may fail. " |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4580 | echo "Example PAM control files can be found in the contrib/ " |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4581 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 4582 | echo "" |
| 4583 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 4584 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 4585 | if test ! -z "$NO_PEERCHECK" ; then |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 4586 | echo "WARNING: the operating system that you are using does not" |
| 4587 | echo "appear to support getpeereid(), getpeerucred() or the" |
| 4588 | echo "SO_PEERCRED getsockopt() option. These facilities are used to" |
| 4589 | echo "enforce security checks to prevent unauthorised connections to" |
| 4590 | echo "ssh-agent. Their absence increases the risk that a malicious" |
| 4591 | echo "user can connect to your agent." |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 4592 | echo "" |
| 4593 | fi |
| 4594 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 4595 | if test "$AUDIT_MODULE" = "bsm" ; then |
| 4596 | echo "WARNING: BSM audit support is currently considered EXPERIMENTAL." |
| 4597 | echo "See the Solaris section in README.platform for details." |
| 4598 | fi |