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