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