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