Kevin Steves | 34f0d8f | 2002-06-24 16:26:49 +0000 | [diff] [blame] | 1 | # $Id: configure.ac,v 1.69 2002/06/24 16:26:49 stevesk Exp $ |
Damien Miller | e9cf357 | 2001-02-09 12:55:35 +1100 | [diff] [blame] | 2 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3 | AC_INIT |
| 4 | AC_CONFIG_SRCDIR([ssh.c]) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 5 | |
| 6 | AC_CONFIG_HEADER(config.h) |
Damien Miller | 856799b | 2000-03-15 21:18:10 +1100 | [diff] [blame] | 7 | AC_PROG_CC |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 8 | AC_CANONICAL_HOST |
Damien Miller | 4df5c76 | 2001-02-28 08:14:22 +1100 | [diff] [blame] | 9 | AC_C_BIGENDIAN |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 10 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 11 | # Checks for programs. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 12 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 13 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 14 | AC_PROG_INSTALL |
Ben Lindstrom | 582d398 | 2001-02-06 22:54:30 +0000 | [diff] [blame] | 15 | AC_PATH_PROG(AR, ar) |
Tim Rice | b8fbb8e | 2001-04-21 14:31:52 -0700 | [diff] [blame] | 16 | AC_PATH_PROGS(PERL, perl5 perl) |
Damien Miller | e79334a | 1999-12-29 10:03:37 +1100 | [diff] [blame] | 17 | AC_SUBST(PERL) |
Damien Miller | 8d1fd57 | 2000-05-17 21:34:07 +1000 | [diff] [blame] | 18 | AC_PATH_PROG(ENT, ent) |
| 19 | AC_SUBST(ENT) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 20 | AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin) |
Damien Miller | 4864e8f | 2001-02-08 10:07:08 +1100 | [diff] [blame] | 21 | AC_PATH_PROG(TEST_MINUS_S_SH, bash) |
| 22 | AC_PATH_PROG(TEST_MINUS_S_SH, ksh) |
| 23 | AC_PATH_PROG(TEST_MINUS_S_SH, sh) |
Tim Rice | 0502a47 | 2002-05-08 16:04:14 -0700 | [diff] [blame] | 24 | AC_PATH_PROG(SH, sh) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 25 | |
Damien Miller | e8bb450 | 2001-09-25 16:39:35 +1000 | [diff] [blame] | 26 | # System features |
| 27 | AC_SYS_LARGEFILE |
| 28 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 29 | if test -z "$AR" ; then |
| 30 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 31 | fi |
| 32 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 33 | # Use LOGIN_PROGRAM from environment if possible |
| 34 | if test ! -z "$LOGIN_PROGRAM" ; then |
| 35 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM") |
| 36 | else |
| 37 | # Search for login |
| 38 | AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login) |
| 39 | if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then |
| 40 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK") |
| 41 | fi |
| 42 | fi |
| 43 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 44 | if test -z "$LD" ; then |
| 45 | LD=$CC |
| 46 | fi |
| 47 | AC_SUBST(LD) |
| 48 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 49 | AC_C_INLINE |
Damien Miller | 649d999 | 2001-06-27 23:35:51 +1000 | [diff] [blame] | 50 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
| 51 | CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized" |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 52 | fi |
| 53 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 54 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 55 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 56 | *-*-aix*) |
| 57 | AFS_LIBS="-lld" |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 58 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 59 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 60 | if (test "$LD" != "gcc" && test -z "$blibpath"); then |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 61 | AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath]) |
| 62 | saved_LDFLAGS="$LDFLAGS" |
| 63 | LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib" |
| 64 | AC_TRY_LINK([], |
| 65 | [], |
| 66 | [ |
| 67 | AC_MSG_RESULT(yes) |
| 68 | blibpath="/usr/lib:/lib:/usr/local/lib" |
| 69 | ], |
| 70 | [ AC_MSG_RESULT(no) ] |
| 71 | ) |
| 72 | LDFLAGS="$saved_LDFLAGS" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 73 | fi |
Damien Miller | d2c208a | 2000-05-17 22:00:02 +1000 | [diff] [blame] | 74 | AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)]) |
Damien Miller | eca71f8 | 2000-01-20 22:38:27 +1100 | [diff] [blame] | 75 | AC_DEFINE(BROKEN_GETADDRINFO) |
Damien Miller | f5fea44 | 2002-04-23 22:52:45 +1000 | [diff] [blame] | 76 | AC_DEFINE(BROKEN_REALPATH) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 77 | dnl AIX handles lastlog as part of its login message |
| 78 | AC_DEFINE(DISABLE_LASTLOG) |
Kevin Steves | 90d5de7 | 2002-06-22 18:51:48 +0000 | [diff] [blame] | 79 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 80 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 81 | *-*-cygwin*) |
Tim Rice | fe1d100 | 2001-11-26 17:19:43 -0800 | [diff] [blame] | 82 | LIBS="$LIBS /usr/lib/textmode.o" |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 83 | AC_DEFINE(HAVE_CYGWIN) |
Ben Lindstrom | ca60a9b | 2001-05-17 03:32:50 +0000 | [diff] [blame] | 84 | AC_DEFINE(USE_PIPES) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 85 | AC_DEFINE(DISABLE_SHADOW) |
| 86 | AC_DEFINE(IPV4_DEFAULT) |
| 87 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Ben Lindstrom | 38e6093 | 2001-02-24 00:55:04 +0000 | [diff] [blame] | 88 | AC_DEFINE(NO_X11_UNIX_SOCKETS) |
Ben Lindstrom | 837461b | 2002-06-12 16:57:14 +0000 | [diff] [blame] | 89 | AC_DEFINE(SETGROUPS_NOOP) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 90 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 91 | *-*-dgux*) |
| 92 | AC_DEFINE(IP_TOS_IS_BROKEN) |
| 93 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 94 | *-*-darwin*) |
| 95 | AC_DEFINE(BROKEN_GETADDRINFO) |
| 96 | ;; |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 97 | *-*-hpux10.26) |
| 98 | if test -z "$GCC"; then |
| 99 | CFLAGS="$CFLAGS -Ae" |
| 100 | fi |
| 101 | CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" |
| 102 | IPADDR_IN_DISPLAY=yes |
| 103 | AC_DEFINE(HAVE_SECUREWARE) |
| 104 | AC_DEFINE(USE_PIPES) |
| 105 | AC_DEFINE(LOGIN_NO_ENDOPT) |
| 106 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
| 107 | AC_DEFINE(DISABLE_SHADOW) |
| 108 | AC_DEFINE(DISABLE_UTMP) |
| 109 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
| 110 | LIBS="$LIBS -lxnet -lsec -lsecpw" |
| 111 | disable_ptmx_check=yes |
| 112 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 113 | *-*-hpux10*) |
| 114 | if test -z "$GCC"; then |
Damien Miller | fda78d9 | 2000-05-20 15:33:44 +1000 | [diff] [blame] | 115 | CFLAGS="$CFLAGS -Ae" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 116 | fi |
Kevin Steves | 315f8b7 | 2001-06-28 00:24:41 +0000 | [diff] [blame] | 117 | 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] | 118 | IPADDR_IN_DISPLAY=yes |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 119 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 5feaaef | 2002-04-23 20:45:55 +0000 | [diff] [blame] | 120 | AC_DEFINE(LOGIN_NO_ENDOPT) |
| 121 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 122 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame] | 123 | AC_DEFINE(DISABLE_UTMP) |
Kevin Steves | 8848b24 | 2000-10-18 13:11:44 +0000 | [diff] [blame] | 124 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
Kevin Steves | 315f8b7 | 2001-06-28 00:24:41 +0000 | [diff] [blame] | 125 | LIBS="$LIBS -lxnet -lsec" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 126 | ;; |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 127 | *-*-hpux11*) |
Kevin Steves | 6a7b0de | 2001-06-27 16:32:24 +0000 | [diff] [blame] | 128 | 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] | 129 | IPADDR_IN_DISPLAY=yes |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 130 | AC_DEFINE(PAM_SUN_CODEBASE) |
Damien Miller | 5552d7a | 2000-08-30 09:53:24 +1100 | [diff] [blame] | 131 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 5feaaef | 2002-04-23 20:45:55 +0000 | [diff] [blame] | 132 | AC_DEFINE(LOGIN_NO_ENDOPT) |
| 133 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 134 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame] | 135 | AC_DEFINE(DISABLE_UTMP) |
Kevin Steves | 8848b24 | 2000-10-18 13:11:44 +0000 | [diff] [blame] | 136 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
Kevin Steves | 6a7b0de | 2001-06-27 16:32:24 +0000 | [diff] [blame] | 137 | LIBS="$LIBS -lxnet -lsec" |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 138 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 139 | *-*-irix5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 140 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 141 | LDFLAGS="$LDFLAGS" |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 142 | PATH="$PATH:/usr/etc" |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 143 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | f1b9d11 | 2002-04-23 23:09:19 +1000 | [diff] [blame] | 144 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 145 | ;; |
| 146 | *-*-irix6*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 147 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 148 | LDFLAGS="$LDFLAGS" |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 149 | PATH="$PATH:/usr/etc" |
Damien Miller | 91606b1 | 2000-06-28 08:22:29 +1000 | [diff] [blame] | 150 | AC_DEFINE(WITH_IRIX_ARRAY) |
| 151 | AC_DEFINE(WITH_IRIX_PROJECT) |
| 152 | AC_DEFINE(WITH_IRIX_AUDIT) |
Ben Lindstrom | 8ff2a8d | 2002-04-06 18:58:31 +0000 | [diff] [blame] | 153 | AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 154 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | f1b9d11 | 2002-04-23 23:09:19 +1000 | [diff] [blame] | 155 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 156 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 157 | *-*-linux*) |
| 158 | no_dev_ptmx=1 |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 159 | check_for_libcrypt_later=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 160 | AC_DEFINE(DONT_TRY_OTHER_AF) |
Damien Miller | 4e99720 | 2000-07-09 21:21:52 +1000 | [diff] [blame] | 161 | AC_DEFINE(PAM_TTY_KLUDGE) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 162 | inet6_default_4in6=yes |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 163 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 164 | mips-sony-bsd|mips-sony-newsos4) |
| 165 | AC_DEFINE(HAVE_NEWS4) |
| 166 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 167 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 168 | *-*-netbsd*) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 169 | need_dash_r=1 |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 170 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 171 | *-*-freebsd*) |
| 172 | check_for_libcrypt_later=1 |
| 173 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 174 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 175 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 176 | conf_utmp_location=/etc/utmp |
| 177 | conf_wtmp_location=/usr/adm/wtmp |
| 178 | MAIL=/usr/spool/mail |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 179 | AC_DEFINE(HAVE_NEXT) |
Ben Lindstrom | b4df15d | 2000-10-15 00:17:36 +0000 | [diff] [blame] | 180 | AC_DEFINE(BROKEN_REALPATH) |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 181 | AC_DEFINE(USE_PIPES) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 182 | AC_DEFINE(BROKEN_SAVED_UIDS) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 183 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Ben Lindstrom | 321ae73 | 2000-12-31 15:00:23 +0000 | [diff] [blame] | 184 | CFLAGS="$CFLAGS" |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 185 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 186 | *-*-solaris*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 187 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Ben Lindstrom | 866488b | 2001-02-20 18:22:38 +0000 | [diff] [blame] | 188 | LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 189 | need_dash_r=1 |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 190 | AC_DEFINE(PAM_SUN_CODEBASE) |
Ben Lindstrom | 97c677d | 2001-05-08 20:33:05 +0000 | [diff] [blame] | 191 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
| 192 | AC_DEFINE(LOGIN_NEEDS_TERM) |
Ben Lindstrom | 9527671 | 2001-10-23 17:14:00 +0000 | [diff] [blame] | 193 | AC_DEFINE(PAM_TTY_KLUDGE) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 194 | # hardwire lastlog location (can't detect it on some versions) |
| 195 | conf_lastlog_location="/var/adm/lastlog" |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 196 | AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) |
| 197 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 198 | if test "$sol2ver" -ge 8; then |
| 199 | AC_MSG_RESULT(yes) |
| 200 | AC_DEFINE(DISABLE_UTMP) |
| 201 | AC_DEFINE(DISABLE_WTMP) |
| 202 | else |
| 203 | AC_MSG_RESULT(no) |
| 204 | fi |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 205 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 206 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 207 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 208 | AC_CHECK_FUNCS(getpwanam) |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 209 | AC_DEFINE(PAM_SUN_CODEBASE) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 210 | conf_utmp_location=/etc/utmp |
| 211 | conf_wtmp_location=/var/adm/wtmp |
| 212 | conf_lastlog_location=/var/adm/lastlog |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 213 | AC_DEFINE(USE_PIPES) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 214 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 215 | *-ncr-sysv*) |
| 216 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
| 217 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 218 | LIBS="$LIBS -lc89" |
Kevin Steves | 0bd4b34 | 2002-01-05 23:24:27 +0000 | [diff] [blame] | 219 | AC_DEFINE(USE_PIPES) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 220 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 221 | *-sni-sysv*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 222 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 223 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
| 224 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 225 | IPADDR_IN_DISPLAY=yes |
| 226 | AC_DEFINE(USE_PIPES) |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 227 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 228 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 229 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 230 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 231 | ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 232 | *-*-sysv4.2*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 233 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 234 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 235 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 236 | ;; |
| 237 | *-*-sysv5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 238 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 239 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 240 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 241 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 242 | *-*-sysv*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 243 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 244 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 245 | ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 246 | *-*-sco3.2v4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 247 | CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 248 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 249 | LIBS="$LIBS -los -lprot -lx -ltinfo -lm" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 250 | RANLIB=true |
| 251 | no_dev_ptmx=1 |
| 252 | AC_DEFINE(BROKEN_SYS_TERMIO_H) |
| 253 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 254 | AC_DEFINE(HAVE_SECUREWARE) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 255 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 256 | AC_DEFINE(BROKEN_SAVED_UIDS) |
Damien Miller | 217f567 | 2001-02-16 12:12:41 +1100 | [diff] [blame] | 257 | AC_CHECK_FUNCS(getluid setluid) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 258 | MANTYPE=man |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 259 | do_sco3_extra_lib_check=yes |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 260 | ;; |
| 261 | *-*-sco3.2v5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 262 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 263 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 264 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 265 | no_dev_ptmx=1 |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 266 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 267 | AC_DEFINE(HAVE_SECUREWARE) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 268 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | 217f567 | 2001-02-16 12:12:41 +1100 | [diff] [blame] | 269 | AC_CHECK_FUNCS(getluid setluid) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 270 | MANTYPE=man |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 271 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 272 | *-*-unicos*) |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 273 | no_libsocket=1 |
| 274 | no_libnsl=1 |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 275 | AC_DEFINE(USE_PIPES) |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 276 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib" |
| 277 | LIBS="$LIBS -lgen -lrsc" |
| 278 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 279 | *-dec-osf*) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 280 | AC_MSG_CHECKING(for Digital Unix SIA) |
| 281 | no_osfsia="" |
| 282 | AC_ARG_WITH(osfsia, |
| 283 | [ --with-osfsia Enable Digital Unix SIA], |
| 284 | [ |
| 285 | if test "x$withval" = "xno" ; then |
| 286 | AC_MSG_RESULT(disabled) |
| 287 | no_osfsia=1 |
| 288 | fi |
| 289 | ], |
| 290 | ) |
| 291 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 292 | if test -f /etc/sia/matrix.conf; then |
| 293 | AC_MSG_RESULT(yes) |
| 294 | AC_DEFINE(HAVE_OSF_SIA) |
| 295 | AC_DEFINE(DISABLE_LOGIN) |
| 296 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
| 297 | else |
| 298 | AC_MSG_RESULT(no) |
| 299 | fi |
| 300 | fi |
| 301 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 302 | |
| 303 | *-*-nto-qnx) |
| 304 | AC_DEFINE(USE_PIPES) |
| 305 | AC_DEFINE(NO_X11_UNIX_SOCKETS) |
| 306 | AC_DEFINE(MISSING_NFDBITS) |
| 307 | AC_DEFINE(MISSING_HOWMANY) |
| 308 | AC_DEFINE(MISSING_FD_MASK) |
| 309 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 310 | esac |
| 311 | |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 312 | # Allow user to specify flags |
| 313 | AC_ARG_WITH(cflags, |
| 314 | [ --with-cflags Specify additional flags to pass to compiler], |
| 315 | [ |
| 316 | if test "x$withval" != "xno" ; then |
| 317 | CFLAGS="$CFLAGS $withval" |
| 318 | fi |
| 319 | ] |
| 320 | ) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 321 | AC_ARG_WITH(cppflags, |
| 322 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 323 | [ |
| 324 | if test "x$withval" != "xno"; then |
| 325 | CPPFLAGS="$CPPFLAGS $withval" |
| 326 | fi |
| 327 | ] |
| 328 | ) |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 329 | AC_ARG_WITH(ldflags, |
Ben Lindstrom | 2ed9818 | 2000-11-06 07:15:43 +0000 | [diff] [blame] | 330 | [ --with-ldflags Specify additional flags to pass to linker], |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 331 | [ |
| 332 | if test "x$withval" != "xno" ; then |
| 333 | LDFLAGS="$LDFLAGS $withval" |
| 334 | fi |
| 335 | ] |
| 336 | ) |
| 337 | AC_ARG_WITH(libs, |
| 338 | [ --with-libs Specify additional libraries to link with], |
| 339 | [ |
| 340 | if test "x$withval" != "xno" ; then |
| 341 | LIBS="$LIBS $withval" |
| 342 | fi |
| 343 | ] |
| 344 | ) |
| 345 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 346 | # Checks for header files. |
| 347 | AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \ |
| 348 | getopt.h glob.h lastlog.h limits.h login.h \ |
| 349 | login_cap.h maillock.h netdb.h netgroup.h \ |
Damien Miller | f71d2a5 | 2002-05-13 15:14:08 +1000 | [diff] [blame] | 350 | netinet/in_systm.h paths.h pty.h readpassphrase.h \ |
Ben Lindstrom | 7577fd8 | 2002-03-08 03:11:07 +0000 | [diff] [blame] | 351 | rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 352 | strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \ |
Kevin Steves | b1184bb | 2002-04-07 18:12:03 +0000 | [diff] [blame] | 353 | sys/mman.h sys/select.h sys/stat.h \ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 354 | sys/stropts.h sys/sysmacros.h sys/time.h \ |
Kevin Steves | 117b06d | 2002-03-30 17:55:21 +0000 | [diff] [blame] | 355 | sys/un.h time.h ttyent.h usersec.h \ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 356 | util.h utime.h utmp.h utmpx.h) |
| 357 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 358 | # Checks for libraries. |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 359 | AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match)) |
| 360 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 361 | |
Damien Miller | df28802 | 2001-02-18 13:07:07 +1100 | [diff] [blame] | 362 | dnl SCO OS3 needs this for libwrap |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 363 | if test "x$with_tcp_wrappers" != "xno" ; then |
| 364 | if test "x$do_sco3_extra_lib_check" = "xyes" ; then |
| 365 | AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc) |
| 366 | fi |
| 367 | fi |
Damien Miller | df28802 | 2001-02-18 13:07:07 +1100 | [diff] [blame] | 368 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 369 | AC_CHECK_FUNC(getspnam, , |
| 370 | AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 371 | |
Damien Miller | 150c8b5 | 2002-02-13 23:06:56 +1100 | [diff] [blame] | 372 | AC_ARG_WITH(rpath, |
| 373 | [ --without-rpath Disable auto-added -R linker paths], |
| 374 | [ |
| 375 | if test "x$withval" = "xno" ; then |
| 376 | need_dash_r="" |
| 377 | fi |
| 378 | if test "x$withval" = "xyes" ; then |
| 379 | need_dash_r=1 |
| 380 | fi |
| 381 | ] |
| 382 | ) |
| 383 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 384 | dnl zlib is required |
| 385 | AC_ARG_WITH(zlib, |
| 386 | [ --with-zlib=PATH Use zlib in PATH], |
| 387 | [ |
Kevin Steves | 7dc8197 | 2002-01-22 21:59:31 +0000 | [diff] [blame] | 388 | if test "x$withval" = "xno" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 389 | AC_MSG_ERROR([*** zlib is required ***]) |
| 390 | fi |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 391 | if test -d "$withval/lib"; then |
| 392 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 393 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 394 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 395 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 396 | fi |
| 397 | else |
| 398 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 399 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 400 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 401 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 402 | fi |
| 403 | fi |
| 404 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 405 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 406 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 407 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 408 | fi |
| 409 | ] |
| 410 | ) |
| 411 | |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 412 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 413 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 414 | dnl UnixWare 2.x |
| 415 | AC_CHECK_FUNC(strcasecmp, |
| 416 | [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ] |
| 417 | ) |
| 418 | AC_CHECK_FUNC(utimes, |
| 419 | [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ] |
| 420 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 421 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 422 | dnl Checks for libutil functions |
| 423 | AC_CHECK_HEADERS(libutil.h) |
| 424 | AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)]) |
| 425 | AC_CHECK_FUNCS(logout updwtmp logwtmp) |
| 426 | |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 427 | AC_FUNC_STRFTIME |
| 428 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 429 | # Check for ALTDIRFUNC glob() extension |
| 430 | AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support) |
| 431 | AC_EGREP_CPP(FOUNDIT, |
| 432 | [ |
| 433 | #include <glob.h> |
| 434 | #ifdef GLOB_ALTDIRFUNC |
| 435 | FOUNDIT |
| 436 | #endif |
| 437 | ], |
| 438 | [ |
| 439 | AC_DEFINE(GLOB_HAS_ALTDIRFUNC) |
| 440 | AC_MSG_RESULT(yes) |
| 441 | ], |
| 442 | [ |
| 443 | AC_MSG_RESULT(no) |
| 444 | ] |
| 445 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 446 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 447 | # Check for g.gl_matchc glob() extension |
| 448 | AC_MSG_CHECKING(for gl_matchc field in glob_t) |
| 449 | AC_EGREP_CPP(FOUNDIT, |
| 450 | [ |
| 451 | #include <glob.h> |
| 452 | int main(void){glob_t g; g.gl_matchc = 1;} |
| 453 | ], |
| 454 | [ |
| 455 | AC_DEFINE(GLOB_HAS_GL_MATCHC) |
| 456 | AC_MSG_RESULT(yes) |
| 457 | ], |
| 458 | [ |
| 459 | AC_MSG_RESULT(no) |
| 460 | ] |
| 461 | ) |
| 462 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 463 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
| 464 | AC_TRY_RUN( |
| 465 | [ |
| 466 | #include <sys/types.h> |
| 467 | #include <dirent.h> |
| 468 | int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));} |
| 469 | ], |
| 470 | [AC_MSG_RESULT(yes)], |
| 471 | [ |
| 472 | AC_MSG_RESULT(no) |
| 473 | AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) |
| 474 | ] |
| 475 | ) |
| 476 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 477 | # Check whether user wants S/Key support |
| 478 | SKEY_MSG="no" |
| 479 | AC_ARG_WITH(skey, |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 480 | [ --with-skey[[=PATH]] Enable S/Key support |
| 481 | (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 482 | [ |
| 483 | if test "x$withval" != "xno" ; then |
| 484 | |
| 485 | if test "x$withval" != "xyes" ; then |
| 486 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 487 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 488 | fi |
| 489 | |
| 490 | AC_DEFINE(SKEY) |
| 491 | LIBS="-lskey $LIBS" |
| 492 | SKEY_MSG="yes" |
| 493 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 494 | AC_MSG_CHECKING([for s/key support]) |
| 495 | AC_TRY_RUN( |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 496 | [ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 497 | #include <stdio.h> |
| 498 | #include <skey.h> |
| 499 | int main() { char *ff = skey_keyinfo(""); ff=""; return 0; } |
| 500 | ], |
| 501 | [AC_MSG_RESULT(yes)], |
| 502 | [ |
| 503 | AC_MSG_RESULT(no) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 504 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 505 | ]) |
| 506 | fi |
| 507 | ] |
| 508 | ) |
| 509 | |
| 510 | # Check whether user wants TCP wrappers support |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 511 | TCPW_MSG="no" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 512 | AC_ARG_WITH(tcp-wrappers, |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 513 | [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support |
| 514 | (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 515 | [ |
| 516 | if test "x$withval" != "xno" ; then |
| 517 | saved_LIBS="$LIBS" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 518 | saved_LDFLAGS="$LDFLAGS" |
| 519 | saved_CPPFLAGS="$CPPFLAGS" |
| 520 | if test -n "${withval}" -a "${withval}" != "yes"; then |
| 521 | if test -d "${withval}/lib"; then |
| 522 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 523 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 524 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 525 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 526 | fi |
| 527 | else |
| 528 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 529 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 530 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 531 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 532 | fi |
| 533 | fi |
| 534 | if test -d "${withval}/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 535 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 536 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 537 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 538 | fi |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 539 | fi |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 540 | LIBWRAP="-lwrap" |
| 541 | LIBS="$LIBWRAP $LIBS" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 542 | AC_MSG_CHECKING(for libwrap) |
| 543 | AC_TRY_LINK( |
| 544 | [ |
| 545 | #include <tcpd.h> |
| 546 | int deny_severity = 0, allow_severity = 0; |
| 547 | ], |
| 548 | [hosts_access(0);], |
| 549 | [ |
| 550 | AC_MSG_RESULT(yes) |
| 551 | AC_DEFINE(LIBWRAP) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 552 | AC_SUBST(LIBWRAP) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 553 | TCPW_MSG="yes" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 554 | ], |
| 555 | [ |
| 556 | AC_MSG_ERROR([*** libwrap missing]) |
| 557 | ] |
| 558 | ) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 559 | LIBS="$saved_LIBS" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 560 | fi |
| 561 | ] |
| 562 | ) |
| 563 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 564 | dnl Checks for library functions. |
Ben Lindstrom | fdee8ef | 2002-04-06 23:52:02 +0000 | [diff] [blame] | 565 | AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \ |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 566 | clock fchmod fchown freeaddrinfo futimes gai_strerror \ |
| 567 | getaddrinfo getcwd getgrouplist getnameinfo getopt \ |
| 568 | getrlimit getrusage getttyent glob inet_aton inet_ntoa \ |
| 569 | inet_ntop innetgr login_getcapbool md5_crypt memmove \ |
Damien Miller | 594a71b | 2002-04-23 20:22:59 +1000 | [diff] [blame] | 570 | mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \ |
| 571 | realpath recvmsg rresvport_af sendmsg setdtablesize setegid \ |
Ben Lindstrom | 837461b | 2002-06-12 16:57:14 +0000 | [diff] [blame] | 572 | setenv seteuid setgroups setlogin setproctitle setresgid setreuid \ |
Ben Lindstrom | f0bfa83 | 2002-06-21 00:01:18 +0000 | [diff] [blame] | 573 | setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \ |
| 574 | socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \ |
| 575 | truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 576 | |
| 577 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 578 | AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[ |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 579 | AC_CHECK_LIB(gen, dirname,[ |
| 580 | AC_CACHE_CHECK([for broken dirname], |
| 581 | ac_cv_have_broken_dirname, [ |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 582 | save_LIBS="$LIBS" |
| 583 | LIBS="$LIBS -lgen" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 584 | AC_TRY_RUN( |
| 585 | [ |
| 586 | #include <libgen.h> |
| 587 | #include <string.h> |
| 588 | |
| 589 | int main(int argc, char **argv) { |
| 590 | char *s, buf[32]; |
| 591 | |
| 592 | strncpy(buf,"/etc", 32); |
| 593 | s = dirname(buf); |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 594 | if (!s || strncmp(s, "/", 32) != 0) { |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 595 | exit(1); |
| 596 | } else { |
| 597 | exit(0); |
| 598 | } |
| 599 | } |
| 600 | ], |
| 601 | [ ac_cv_have_broken_dirname="no" ], |
| 602 | [ ac_cv_have_broken_dirname="yes" ] |
| 603 | ) |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 604 | LIBS="$save_LIBS" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 605 | ]) |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 606 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 607 | LIBS="$LIBS -lgen" |
| 608 | AC_DEFINE(HAVE_DIRNAME) |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 609 | AC_CHECK_HEADERS(libgen.h) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 610 | fi |
| 611 | ]) |
| 612 | ]) |
| 613 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 614 | dnl Checks for time functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 615 | AC_CHECK_FUNCS(gettimeofday time) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 616 | dnl Checks for utmp functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 617 | AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 618 | AC_CHECK_FUNCS(utmpname) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 619 | dnl Checks for utmpx functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 620 | AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 621 | AC_CHECK_FUNCS(setutxent utmpxname) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 622 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 623 | AC_CHECK_FUNC(daemon, |
| 624 | [AC_DEFINE(HAVE_DAEMON)], |
| 625 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 626 | ) |
| 627 | |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 628 | AC_CHECK_FUNC(getpagesize, |
| 629 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 630 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 631 | ) |
| 632 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 633 | # Check for broken snprintf |
| 634 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 635 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
| 636 | AC_TRY_RUN( |
| 637 | [ |
| 638 | #include <stdio.h> |
| 639 | int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');} |
| 640 | ], |
| 641 | [AC_MSG_RESULT(yes)], |
| 642 | [ |
| 643 | AC_MSG_RESULT(no) |
| 644 | AC_DEFINE(BROKEN_SNPRINTF) |
| 645 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
| 646 | ] |
| 647 | ) |
| 648 | fi |
| 649 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 650 | AC_FUNC_GETPGRP |
| 651 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 652 | # Check for PAM libs |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 653 | PAM_MSG="no" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 654 | AC_ARG_WITH(pam, |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 655 | [ --with-pam Enable PAM support ], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 656 | [ |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 657 | if test "x$withval" != "xno" ; then |
| 658 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then |
| 659 | AC_MSG_ERROR([PAM headers not found]) |
| 660 | fi |
| 661 | |
| 662 | AC_CHECK_LIB(dl, dlopen, , ) |
| 663 | AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing])) |
| 664 | AC_CHECK_FUNCS(pam_getenvlist) |
| 665 | |
| 666 | disable_shadow=yes |
| 667 | PAM_MSG="yes" |
| 668 | |
| 669 | AC_DEFINE(USE_PAM) |
Tim Rice | 7d2d1f1 | 2002-02-26 22:05:11 -0800 | [diff] [blame] | 670 | if test $ac_cv_lib_dl_dlopen = yes; then |
| 671 | LIBPAM="-lpam -ldl" |
| 672 | else |
| 673 | LIBPAM="-lpam" |
| 674 | fi |
| 675 | AC_SUBST(LIBPAM) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 676 | fi |
| 677 | ] |
| 678 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 679 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 680 | # Check for older PAM |
| 681 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 682 | # Check PAM strerror arguments (old PAM) |
| 683 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 684 | AC_TRY_COMPILE( |
| 685 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 686 | #include <stdlib.h> |
| 687 | #include <security/pam_appl.h> |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 688 | ], |
| 689 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 690 | [AC_MSG_RESULT(no)], |
| 691 | [ |
| 692 | AC_DEFINE(HAVE_OLD_PAM) |
| 693 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 694 | PAM_MSG="yes (old library)" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 695 | ] |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 696 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 697 | fi |
| 698 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 699 | # Search for OpenSSL |
| 700 | saved_CPPFLAGS="$CPPFLAGS" |
| 701 | saved_LDFLAGS="$LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 702 | AC_ARG_WITH(ssl-dir, |
| 703 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 704 | [ |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 705 | if test "x$withval" != "xno" ; then |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 706 | if test -d "$withval/lib"; then |
| 707 | if test -n "${need_dash_r}"; then |
| 708 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 709 | else |
| 710 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 711 | fi |
| 712 | else |
| 713 | if test -n "${need_dash_r}"; then |
| 714 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
| 715 | else |
| 716 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 717 | fi |
| 718 | fi |
| 719 | if test -d "$withval/include"; then |
| 720 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 721 | else |
| 722 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 723 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 724 | fi |
| 725 | ] |
| 726 | ) |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 727 | LIBS="$LIBS -lcrypto" |
| 728 | AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 729 | [ |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 730 | dnl Check default openssl install dir |
| 731 | if test -n "${need_dash_r}"; then |
| 732 | 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] | 733 | else |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 734 | LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 735 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 736 | CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" |
| 737 | AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), |
| 738 | [ |
| 739 | AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) |
| 740 | ] |
| 741 | ) |
| 742 | ] |
| 743 | ) |
| 744 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 745 | |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 746 | # Sanity check OpenSSL headers |
| 747 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
| 748 | AC_TRY_RUN( |
| 749 | [ |
| 750 | #include <string.h> |
| 751 | #include <openssl/opensslv.h> |
| 752 | int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); } |
| 753 | ], |
| 754 | [ |
| 755 | AC_MSG_RESULT(yes) |
| 756 | ], |
| 757 | [ |
| 758 | AC_MSG_RESULT(no) |
| 759 | AC_MSG_ERROR(Your OpenSSL headers do not match your library) |
| 760 | ] |
| 761 | ) |
| 762 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 763 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
| 764 | # version in OpenSSL. Skip this for PAM |
| 765 | if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then |
Damien Miller | 95aa2d6 | 2001-03-01 09:16:11 +1100 | [diff] [blame] | 766 | AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 767 | fi |
| 768 | |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 769 | |
| 770 | ### Configure cryptographic random number support |
| 771 | |
| 772 | # Check wheter OpenSSL seeds itself |
| 773 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
| 774 | AC_TRY_RUN( |
| 775 | [ |
| 776 | #include <string.h> |
| 777 | #include <openssl/rand.h> |
| 778 | int main(void) { return(RAND_status() == 1 ? 0 : 1); } |
| 779 | ], |
| 780 | [ |
| 781 | OPENSSL_SEEDS_ITSELF=yes |
| 782 | AC_MSG_RESULT(yes) |
| 783 | ], |
| 784 | [ |
| 785 | AC_MSG_RESULT(no) |
| 786 | # Default to use of the rand helper if OpenSSL doesn't |
| 787 | # seed itself |
| 788 | USE_RAND_HELPER=yes |
| 789 | ] |
| 790 | ) |
| 791 | |
| 792 | |
| 793 | # Do we want to force the use of the rand helper? |
| 794 | AC_ARG_WITH(rand-helper, |
| 795 | [ --with-rand-helper Use subprocess to gather strong randomness ], |
| 796 | [ |
| 797 | if test "x$withval" = "xno" ; then |
| 798 | # Force use of OpenSSL's internal RNG, even if |
| 799 | # the previous test showed it to be unseeded. |
| 800 | if test -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 801 | AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG]) |
| 802 | OPENSSL_SEEDS_ITSELF=yes |
| 803 | USE_RAND_HELPER="" |
| 804 | fi |
| 805 | else |
| 806 | USE_RAND_HELPER=yes |
| 807 | fi |
| 808 | ], |
| 809 | ) |
| 810 | |
| 811 | # Which randomness source do we use? |
| 812 | if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then |
| 813 | # OpenSSL only |
| 814 | AC_DEFINE(OPENSSL_PRNG_ONLY) |
| 815 | RAND_MSG="OpenSSL internal ONLY" |
| 816 | INSTALL_SSH_RAND_HELPER="" |
Tim Rice | 1e2c600 | 2002-01-30 22:14:03 -0800 | [diff] [blame] | 817 | elif test ! -z "$USE_RAND_HELPER" ; then |
| 818 | # install rand helper |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 819 | RAND_MSG="ssh-rand-helper" |
| 820 | INSTALL_SSH_RAND_HELPER="yes" |
| 821 | fi |
| 822 | AC_SUBST(INSTALL_SSH_RAND_HELPER) |
| 823 | |
| 824 | ### Configuration of ssh-rand-helper |
| 825 | |
| 826 | # PRNGD TCP socket |
| 827 | AC_ARG_WITH(prngd-port, |
| 828 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 829 | [ |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 830 | case "$withval" in |
| 831 | no) |
| 832 | withval="" |
| 833 | ;; |
| 834 | [[0-9]]*) |
| 835 | ;; |
| 836 | *) |
| 837 | AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port) |
| 838 | ;; |
| 839 | esac |
| 840 | if test ! -z "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 841 | PRNGD_PORT="$withval" |
| 842 | AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT) |
| 843 | fi |
| 844 | ] |
| 845 | ) |
| 846 | |
| 847 | # PRNGD Unix domain socket |
| 848 | AC_ARG_WITH(prngd-socket, |
| 849 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 850 | [ |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 851 | case "$withval" in |
| 852 | yes) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 853 | withval="/var/run/egd-pool" |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 854 | ;; |
| 855 | no) |
| 856 | withval="" |
| 857 | ;; |
| 858 | /*) |
| 859 | ;; |
| 860 | *) |
| 861 | AC_MSG_ERROR(You must specify an absolute path to the entropy socket) |
| 862 | ;; |
| 863 | esac |
| 864 | |
| 865 | if test ! -z "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 866 | if test ! -z "$PRNGD_PORT" ; then |
| 867 | AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket) |
| 868 | fi |
Damien Miller | 6385ba0 | 2002-01-23 08:12:36 +1100 | [diff] [blame] | 869 | if test ! -r "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 870 | AC_MSG_WARN(Entropy socket is not readable) |
| 871 | fi |
| 872 | PRNGD_SOCKET="$withval" |
| 873 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
| 874 | fi |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 875 | ], |
| 876 | [ |
| 877 | # Check for existing socket only if we don't have a random device already |
| 878 | if test "$USE_RAND_HELPER" = yes ; then |
| 879 | AC_MSG_CHECKING(for PRNGD/EGD socket) |
| 880 | # Insert other locations here |
| 881 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 882 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 883 | PRNGD_SOCKET="$sock" |
| 884 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
| 885 | break; |
| 886 | fi |
| 887 | done |
| 888 | if test ! -z "$PRNGD_SOCKET" ; then |
| 889 | AC_MSG_RESULT($PRNGD_SOCKET) |
| 890 | else |
| 891 | AC_MSG_RESULT(not found) |
| 892 | fi |
| 893 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 894 | ] |
| 895 | ) |
| 896 | |
| 897 | # Change default command timeout for hashing entropy source |
| 898 | entropy_timeout=200 |
| 899 | AC_ARG_WITH(entropy-timeout, |
| 900 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 901 | [ |
| 902 | if test "x$withval" != "xno" ; then |
| 903 | entropy_timeout=$withval |
| 904 | fi |
| 905 | ] |
| 906 | ) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 907 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) |
| 908 | |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 909 | ssh_privsep_user=sshd |
| 910 | AC_ARG_WITH(privsep-user, |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 911 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 912 | [ |
| 913 | if test -n "$withval"; then |
| 914 | ssh_privsep_user=$withval |
| 915 | fi |
| 916 | ] |
| 917 | ) |
Kevin Steves | 4e0bb52 | 2002-04-07 19:44:14 +0000 | [diff] [blame] | 918 | AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$ssh_privsep_user") |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 919 | |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 920 | # We do this little dance with the search path to insure |
| 921 | # that programs that we select for use by installed programs |
| 922 | # (which may be run by the super-user) come from trusted |
| 923 | # locations before they come from the user's private area. |
| 924 | # This should help avoid accidentally configuring some |
| 925 | # random version of a program in someone's personal bin. |
| 926 | |
| 927 | OPATH=$PATH |
| 928 | PATH=/bin:/usr/bin |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 929 | test -h /bin 2> /dev/null && PATH=/usr/bin |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 930 | test -d /sbin && PATH=$PATH:/sbin |
| 931 | test -d /usr/sbin && PATH=$PATH:/usr/sbin |
| 932 | PATH=$PATH:/etc:$OPATH |
| 933 | |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 934 | # These programs are used by the command hashing source to gather entropy |
| 935 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
| 936 | OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) |
| 937 | OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp) |
| 938 | OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig) |
| 939 | OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat) |
| 940 | OSSH_PATH_ENTROPY_PROG(PROG_PS, ps) |
| 941 | OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar) |
| 942 | OSSH_PATH_ENTROPY_PROG(PROG_W, w) |
| 943 | OSSH_PATH_ENTROPY_PROG(PROG_WHO, who) |
| 944 | OSSH_PATH_ENTROPY_PROG(PROG_LAST, last) |
| 945 | OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog) |
| 946 | OSSH_PATH_ENTROPY_PROG(PROG_DF, df) |
| 947 | OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) |
| 948 | OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) |
| 949 | OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) |
| 950 | OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 951 | # restore PATH |
| 952 | PATH=$OPATH |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 953 | |
| 954 | # Where does ssh-rand-helper get its randomness from? |
| 955 | INSTALL_SSH_PRNG_CMDS="" |
| 956 | if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then |
| 957 | if test ! -z "$PRNGD_PORT" ; then |
| 958 | RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT" |
| 959 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 960 | RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\"" |
| 961 | else |
| 962 | RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)" |
| 963 | RAND_HELPER_CMDHASH=yes |
| 964 | INSTALL_SSH_PRNG_CMDS="yes" |
| 965 | fi |
| 966 | fi |
| 967 | AC_SUBST(INSTALL_SSH_PRNG_CMDS) |
| 968 | |
| 969 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 970 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 971 | if test ! -z "$SONY" ; then |
| 972 | LIBS="$LIBS -liberty"; |
| 973 | fi |
| 974 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 975 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 976 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 977 | AC_CHECK_SIZEOF(short int, 2) |
| 978 | AC_CHECK_SIZEOF(int, 4) |
| 979 | AC_CHECK_SIZEOF(long int, 4) |
| 980 | AC_CHECK_SIZEOF(long long int, 8) |
| 981 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 982 | # Sanity check long long for some platforms (AIX) |
| 983 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 984 | ac_cv_sizeof_long_long_int=0 |
| 985 | fi |
| 986 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 987 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 988 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
| 989 | AC_TRY_COMPILE( |
| 990 | [ #include <sys/types.h> ], |
| 991 | [ u_int a; a = 1;], |
| 992 | [ ac_cv_have_u_int="yes" ], |
| 993 | [ ac_cv_have_u_int="no" ] |
| 994 | ) |
| 995 | ]) |
| 996 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
| 997 | AC_DEFINE(HAVE_U_INT) |
| 998 | have_u_int=1 |
| 999 | fi |
| 1000 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1001 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
| 1002 | AC_TRY_COMPILE( |
| 1003 | [ #include <sys/types.h> ], |
| 1004 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
| 1005 | [ ac_cv_have_intxx_t="yes" ], |
| 1006 | [ ac_cv_have_intxx_t="no" ] |
| 1007 | ) |
| 1008 | ]) |
| 1009 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
| 1010 | AC_DEFINE(HAVE_INTXX_T) |
| 1011 | have_intxx_t=1 |
| 1012 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1013 | |
| 1014 | if (test -z "$have_intxx_t" && \ |
| 1015 | test "x$ac_cv_header_stdint_h" = "xyes") |
| 1016 | then |
| 1017 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
| 1018 | AC_TRY_COMPILE( |
| 1019 | [ #include <stdint.h> ], |
| 1020 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
| 1021 | [ |
| 1022 | AC_DEFINE(HAVE_INTXX_T) |
| 1023 | AC_MSG_RESULT(yes) |
| 1024 | ], |
| 1025 | [ AC_MSG_RESULT(no) ] |
| 1026 | ) |
| 1027 | fi |
| 1028 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 1029 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
| 1030 | AC_TRY_COMPILE( |
| 1031 | [ #include <sys/types.h> ], |
| 1032 | [ int64_t a; a = 1;], |
| 1033 | [ ac_cv_have_int64_t="yes" ], |
| 1034 | [ ac_cv_have_int64_t="no" ] |
| 1035 | ) |
| 1036 | ]) |
| 1037 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
| 1038 | AC_DEFINE(HAVE_INT64_T) |
| 1039 | have_int64_t=1 |
| 1040 | fi |
| 1041 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1042 | if test -z "$have_int64_t" ; then |
| 1043 | AC_MSG_CHECKING([for int64_t type in sys/socket.h]) |
| 1044 | AC_TRY_COMPILE( |
| 1045 | [ #include <sys/socket.h> ], |
| 1046 | [ int64_t a; a = 1], |
| 1047 | [ |
| 1048 | AC_DEFINE(HAVE_INT64_T) |
| 1049 | AC_MSG_RESULT(yes) |
| 1050 | ], |
| 1051 | [ AC_MSG_RESULT(no) ] |
| 1052 | ) |
| 1053 | fi |
| 1054 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1055 | if test -z "$have_int64_t" ; then |
| 1056 | AC_MSG_CHECKING([for int64_t type in sys/bitypes.h]) |
| 1057 | AC_TRY_COMPILE( |
| 1058 | [ #include <sys/bitypes.h> ], |
| 1059 | [ int64_t a; a = 1], |
| 1060 | [ |
| 1061 | AC_DEFINE(HAVE_INT64_T) |
| 1062 | AC_MSG_RESULT(yes) |
| 1063 | ], |
| 1064 | [ AC_MSG_RESULT(no) ] |
| 1065 | ) |
| 1066 | fi |
| 1067 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1068 | AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ |
| 1069 | AC_TRY_COMPILE( |
| 1070 | [ #include <sys/types.h> ], |
| 1071 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
| 1072 | [ ac_cv_have_u_intxx_t="yes" ], |
| 1073 | [ ac_cv_have_u_intxx_t="no" ] |
| 1074 | ) |
| 1075 | ]) |
| 1076 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
| 1077 | AC_DEFINE(HAVE_U_INTXX_T) |
| 1078 | have_u_intxx_t=1 |
| 1079 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 1080 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1081 | if test -z "$have_u_intxx_t" ; then |
| 1082 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
| 1083 | AC_TRY_COMPILE( |
| 1084 | [ #include <sys/socket.h> ], |
| 1085 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
| 1086 | [ |
| 1087 | AC_DEFINE(HAVE_U_INTXX_T) |
| 1088 | AC_MSG_RESULT(yes) |
| 1089 | ], |
| 1090 | [ AC_MSG_RESULT(no) ] |
| 1091 | ) |
| 1092 | fi |
| 1093 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 1094 | AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ |
| 1095 | AC_TRY_COMPILE( |
| 1096 | [ #include <sys/types.h> ], |
| 1097 | [ u_int64_t a; a = 1;], |
| 1098 | [ ac_cv_have_u_int64_t="yes" ], |
| 1099 | [ ac_cv_have_u_int64_t="no" ] |
| 1100 | ) |
| 1101 | ]) |
| 1102 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
| 1103 | AC_DEFINE(HAVE_U_INT64_T) |
| 1104 | have_u_int64_t=1 |
| 1105 | fi |
| 1106 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1107 | if test -z "$have_u_int64_t" ; then |
| 1108 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
| 1109 | AC_TRY_COMPILE( |
| 1110 | [ #include <sys/bitypes.h> ], |
| 1111 | [ u_int64_t a; a = 1], |
| 1112 | [ |
| 1113 | AC_DEFINE(HAVE_U_INT64_T) |
| 1114 | AC_MSG_RESULT(yes) |
| 1115 | ], |
| 1116 | [ AC_MSG_RESULT(no) ] |
| 1117 | ) |
| 1118 | fi |
| 1119 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1120 | if test -z "$have_u_intxx_t" ; then |
| 1121 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
| 1122 | AC_TRY_COMPILE( |
| 1123 | [ |
| 1124 | #include <sys/types.h> |
| 1125 | ], |
| 1126 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], |
| 1127 | [ ac_cv_have_uintxx_t="yes" ], |
| 1128 | [ ac_cv_have_uintxx_t="no" ] |
| 1129 | ) |
| 1130 | ]) |
| 1131 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
| 1132 | AC_DEFINE(HAVE_UINTXX_T) |
| 1133 | fi |
| 1134 | fi |
| 1135 | |
| 1136 | if test -z "$have_uintxx_t" ; then |
| 1137 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
| 1138 | AC_TRY_COMPILE( |
| 1139 | [ #include <stdint.h> ], |
| 1140 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;], |
| 1141 | [ |
| 1142 | AC_DEFINE(HAVE_UINTXX_T) |
| 1143 | AC_MSG_RESULT(yes) |
| 1144 | ], |
| 1145 | [ AC_MSG_RESULT(no) ] |
| 1146 | ) |
| 1147 | fi |
| 1148 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 1149 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
| 1150 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 1151 | then |
| 1152 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 1153 | AC_TRY_COMPILE( |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1154 | [ |
| 1155 | #include <sys/bitypes.h> |
| 1156 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 1157 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 1158 | int8_t a; int16_t b; int32_t c; |
| 1159 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 1160 | a = b = c = e = f = g = 1; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 1161 | ], |
| 1162 | [ |
| 1163 | AC_DEFINE(HAVE_U_INTXX_T) |
| 1164 | AC_DEFINE(HAVE_INTXX_T) |
| 1165 | AC_MSG_RESULT(yes) |
| 1166 | ], |
| 1167 | [AC_MSG_RESULT(no)] |
| 1168 | ) |
| 1169 | fi |
| 1170 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 1171 | |
| 1172 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
| 1173 | AC_TRY_COMPILE( |
| 1174 | [ |
| 1175 | #include <sys/types.h> |
| 1176 | ], |
| 1177 | [ u_char foo; foo = 125; ], |
| 1178 | [ ac_cv_have_u_char="yes" ], |
| 1179 | [ ac_cv_have_u_char="no" ] |
| 1180 | ) |
| 1181 | ]) |
| 1182 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
| 1183 | AC_DEFINE(HAVE_U_CHAR) |
| 1184 | fi |
| 1185 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1186 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 1187 | |
Tim Rice | 200a5c0 | 2002-02-26 22:12:34 -0800 | [diff] [blame] | 1188 | AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1189 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1190 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
| 1191 | AC_TRY_COMPILE( |
| 1192 | [ |
| 1193 | #include <sys/types.h> |
| 1194 | ], |
| 1195 | [ size_t foo; foo = 1235; ], |
| 1196 | [ ac_cv_have_size_t="yes" ], |
| 1197 | [ ac_cv_have_size_t="no" ] |
| 1198 | ) |
| 1199 | ]) |
| 1200 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
| 1201 | AC_DEFINE(HAVE_SIZE_T) |
| 1202 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 1203 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 1204 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
| 1205 | AC_TRY_COMPILE( |
| 1206 | [ |
| 1207 | #include <sys/types.h> |
| 1208 | ], |
| 1209 | [ ssize_t foo; foo = 1235; ], |
| 1210 | [ ac_cv_have_ssize_t="yes" ], |
| 1211 | [ ac_cv_have_ssize_t="no" ] |
| 1212 | ) |
| 1213 | ]) |
| 1214 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
| 1215 | AC_DEFINE(HAVE_SSIZE_T) |
| 1216 | fi |
| 1217 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 1218 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
| 1219 | AC_TRY_COMPILE( |
| 1220 | [ |
| 1221 | #include <time.h> |
| 1222 | ], |
| 1223 | [ clock_t foo; foo = 1235; ], |
| 1224 | [ ac_cv_have_clock_t="yes" ], |
| 1225 | [ ac_cv_have_clock_t="no" ] |
| 1226 | ) |
| 1227 | ]) |
| 1228 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
| 1229 | AC_DEFINE(HAVE_CLOCK_T) |
| 1230 | fi |
| 1231 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 1232 | AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ |
| 1233 | AC_TRY_COMPILE( |
| 1234 | [ |
| 1235 | #include <sys/types.h> |
| 1236 | #include <sys/socket.h> |
| 1237 | ], |
| 1238 | [ sa_family_t foo; foo = 1235; ], |
| 1239 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1240 | [ AC_TRY_COMPILE( |
| 1241 | [ |
| 1242 | #include <sys/types.h> |
| 1243 | #include <sys/socket.h> |
| 1244 | #include <netinet/in.h> |
| 1245 | ], |
| 1246 | [ sa_family_t foo; foo = 1235; ], |
| 1247 | [ ac_cv_have_sa_family_t="yes" ], |
| 1248 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 1249 | [ ac_cv_have_sa_family_t="no" ] |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1250 | )] |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 1251 | ) |
| 1252 | ]) |
| 1253 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
| 1254 | AC_DEFINE(HAVE_SA_FAMILY_T) |
| 1255 | fi |
| 1256 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 1257 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
| 1258 | AC_TRY_COMPILE( |
| 1259 | [ |
| 1260 | #include <sys/types.h> |
| 1261 | ], |
| 1262 | [ pid_t foo; foo = 1235; ], |
| 1263 | [ ac_cv_have_pid_t="yes" ], |
| 1264 | [ ac_cv_have_pid_t="no" ] |
| 1265 | ) |
| 1266 | ]) |
| 1267 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
| 1268 | AC_DEFINE(HAVE_PID_T) |
| 1269 | fi |
| 1270 | |
| 1271 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
| 1272 | AC_TRY_COMPILE( |
| 1273 | [ |
| 1274 | #include <sys/types.h> |
| 1275 | ], |
| 1276 | [ mode_t foo; foo = 1235; ], |
| 1277 | [ ac_cv_have_mode_t="yes" ], |
| 1278 | [ ac_cv_have_mode_t="no" ] |
| 1279 | ) |
| 1280 | ]) |
| 1281 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
| 1282 | AC_DEFINE(HAVE_MODE_T) |
| 1283 | fi |
| 1284 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1285 | |
| 1286 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
| 1287 | AC_TRY_COMPILE( |
| 1288 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1289 | #include <sys/types.h> |
| 1290 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1291 | ], |
| 1292 | [ struct sockaddr_storage s; ], |
| 1293 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 1294 | [ ac_cv_have_struct_sockaddr_storage="no" ] |
| 1295 | ) |
| 1296 | ]) |
| 1297 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
| 1298 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 1299 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 1300 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1301 | AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
| 1302 | AC_TRY_COMPILE( |
| 1303 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1304 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1305 | #include <netinet/in.h> |
| 1306 | ], |
| 1307 | [ struct sockaddr_in6 s; s.sin6_family = 0; ], |
| 1308 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 1309 | [ ac_cv_have_struct_sockaddr_in6="no" ] |
| 1310 | ) |
| 1311 | ]) |
| 1312 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
| 1313 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 1314 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 1315 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1316 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
| 1317 | AC_TRY_COMPILE( |
| 1318 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1319 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1320 | #include <netinet/in.h> |
| 1321 | ], |
| 1322 | [ struct in6_addr s; s.s6_addr[0] = 0; ], |
| 1323 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 1324 | [ ac_cv_have_struct_in6_addr="no" ] |
| 1325 | ) |
| 1326 | ]) |
| 1327 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
| 1328 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 1329 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 1330 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1331 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
| 1332 | AC_TRY_COMPILE( |
| 1333 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1334 | #include <sys/types.h> |
| 1335 | #include <sys/socket.h> |
| 1336 | #include <netdb.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1337 | ], |
| 1338 | [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], |
| 1339 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 1340 | [ ac_cv_have_struct_addrinfo="no" ] |
| 1341 | ) |
| 1342 | ]) |
| 1343 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
| 1344 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 1345 | fi |
| 1346 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 1347 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
| 1348 | AC_TRY_COMPILE( |
| 1349 | [ #include <sys/time.h> ], |
| 1350 | [ struct timeval tv; tv.tv_sec = 1;], |
| 1351 | [ ac_cv_have_struct_timeval="yes" ], |
| 1352 | [ ac_cv_have_struct_timeval="no" ] |
| 1353 | ) |
| 1354 | ]) |
| 1355 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
| 1356 | AC_DEFINE(HAVE_STRUCT_TIMEVAL) |
| 1357 | have_struct_timeval=1 |
| 1358 | fi |
| 1359 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1360 | # If we don't have int64_t then we can't compile sftp-server. So don't |
| 1361 | # even attempt to do it. |
| 1362 | if test "x$ac_cv_have_int64_t" = "xno" -a \ |
| 1363 | "x$ac_cv_sizeof_long_int" != "x8" -a \ |
| 1364 | "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
| 1365 | NO_SFTP='#' |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 1366 | else |
| 1367 | dnl test snprintf (broken on SCO w/gcc) |
| 1368 | AC_TRY_RUN( |
| 1369 | [ |
| 1370 | #include <stdio.h> |
| 1371 | #include <string.h> |
| 1372 | #ifdef HAVE_SNPRINTF |
| 1373 | main() |
| 1374 | { |
| 1375 | char buf[50]; |
| 1376 | char expected_out[50]; |
| 1377 | int mazsize = 50 ; |
| 1378 | #if (SIZEOF_LONG_INT == 8) |
| 1379 | long int num = 0x7fffffffffffffff; |
| 1380 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 1381 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 1382 | #endif |
| 1383 | strcpy(expected_out, "9223372036854775807"); |
| 1384 | snprintf(buf, mazsize, "%lld", num); |
| 1385 | if(strcmp(buf, expected_out) != 0) |
| 1386 | exit(1); |
| 1387 | exit(0); |
| 1388 | } |
| 1389 | #else |
| 1390 | main() { exit(0); } |
| 1391 | #endif |
| 1392 | ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ] |
| 1393 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1394 | fi |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 1395 | AC_SUBST(NO_SFTP) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1396 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1397 | dnl Checks for structure members |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1398 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) |
| 1399 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) |
| 1400 | OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) |
| 1401 | OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) |
| 1402 | 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] | 1403 | 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] | 1404 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) |
| 1405 | 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] | 1406 | 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] | 1407 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) |
| 1408 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) |
| 1409 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) |
| 1410 | 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] | 1411 | OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP) |
| 1412 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP) |
| 1413 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) |
| 1414 | 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] | 1415 | |
| 1416 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1417 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1418 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 1419 | ac_cv_have_ss_family_in_struct_ss, [ |
| 1420 | AC_TRY_COMPILE( |
| 1421 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1422 | #include <sys/types.h> |
| 1423 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1424 | ], |
| 1425 | [ struct sockaddr_storage s; s.ss_family = 1; ], |
| 1426 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 1427 | [ ac_cv_have_ss_family_in_struct_ss="no" ], |
| 1428 | ) |
| 1429 | ]) |
| 1430 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
| 1431 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 1432 | fi |
| 1433 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1434 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 1435 | ac_cv_have___ss_family_in_struct_ss, [ |
| 1436 | AC_TRY_COMPILE( |
| 1437 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1438 | #include <sys/types.h> |
| 1439 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1440 | ], |
| 1441 | [ struct sockaddr_storage s; s.__ss_family = 1; ], |
| 1442 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 1443 | [ ac_cv_have___ss_family_in_struct_ss="no" ] |
| 1444 | ) |
| 1445 | ]) |
| 1446 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
| 1447 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 1448 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 1449 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1450 | AC_CACHE_CHECK([for pw_class field in struct passwd], |
| 1451 | ac_cv_have_pw_class_in_struct_passwd, [ |
| 1452 | AC_TRY_COMPILE( |
| 1453 | [ |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1454 | #include <pwd.h> |
| 1455 | ], |
Kevin Steves | 48b7cc0 | 2000-10-07 13:24:00 +0000 | [diff] [blame] | 1456 | [ struct passwd p; p.pw_class = 0; ], |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1457 | [ ac_cv_have_pw_class_in_struct_passwd="yes" ], |
| 1458 | [ ac_cv_have_pw_class_in_struct_passwd="no" ] |
| 1459 | ) |
| 1460 | ]) |
| 1461 | if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then |
| 1462 | AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD) |
| 1463 | fi |
| 1464 | |
Kevin Steves | 8245695 | 2001-06-22 21:14:18 +0000 | [diff] [blame] | 1465 | AC_CACHE_CHECK([for pw_expire field in struct passwd], |
| 1466 | ac_cv_have_pw_expire_in_struct_passwd, [ |
| 1467 | AC_TRY_COMPILE( |
| 1468 | [ |
| 1469 | #include <pwd.h> |
| 1470 | ], |
| 1471 | [ struct passwd p; p.pw_expire = 0; ], |
| 1472 | [ ac_cv_have_pw_expire_in_struct_passwd="yes" ], |
| 1473 | [ ac_cv_have_pw_expire_in_struct_passwd="no" ] |
| 1474 | ) |
| 1475 | ]) |
| 1476 | if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then |
| 1477 | AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD) |
| 1478 | fi |
| 1479 | |
| 1480 | AC_CACHE_CHECK([for pw_change field in struct passwd], |
| 1481 | ac_cv_have_pw_change_in_struct_passwd, [ |
| 1482 | AC_TRY_COMPILE( |
| 1483 | [ |
| 1484 | #include <pwd.h> |
| 1485 | ], |
| 1486 | [ struct passwd p; p.pw_change = 0; ], |
| 1487 | [ ac_cv_have_pw_change_in_struct_passwd="yes" ], |
| 1488 | [ ac_cv_have_pw_change_in_struct_passwd="no" ] |
| 1489 | ) |
| 1490 | ]) |
| 1491 | if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then |
| 1492 | AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD) |
| 1493 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1494 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 1495 | 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] | 1496 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 1497 | ac_cv_have_accrights_in_msghdr, [ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 1498 | AC_TRY_RUN( |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 1499 | [ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 1500 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 1501 | #include <sys/socket.h> |
| 1502 | #include <sys/uio.h> |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 1503 | int main() { |
| 1504 | #ifdef msg_accrights |
| 1505 | exit(1); |
| 1506 | #endif |
| 1507 | struct msghdr m; |
| 1508 | m.msg_accrights = 0; |
| 1509 | exit(0); |
| 1510 | } |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 1511 | ], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 1512 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 1513 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 1514 | ) |
| 1515 | ]) |
| 1516 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
| 1517 | AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR) |
| 1518 | fi |
| 1519 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 1520 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 1521 | ac_cv_have_control_in_msghdr, [ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 1522 | AC_TRY_RUN( |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 1523 | [ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 1524 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 1525 | #include <sys/socket.h> |
| 1526 | #include <sys/uio.h> |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 1527 | int main() { |
| 1528 | #ifdef msg_control |
| 1529 | exit(1); |
| 1530 | #endif |
| 1531 | struct msghdr m; |
| 1532 | m.msg_control = 0; |
| 1533 | exit(0); |
| 1534 | } |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 1535 | ], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 1536 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 1537 | [ ac_cv_have_control_in_msghdr="no" ] |
| 1538 | ) |
| 1539 | ]) |
| 1540 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
| 1541 | AC_DEFINE(HAVE_CONTROL_IN_MSGHDR) |
| 1542 | fi |
| 1543 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1544 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
| 1545 | AC_TRY_LINK([], |
| 1546 | [ extern char *__progname; printf("%s", __progname); ], |
| 1547 | [ ac_cv_libc_defines___progname="yes" ], |
| 1548 | [ ac_cv_libc_defines___progname="no" ] |
| 1549 | ) |
| 1550 | ]) |
| 1551 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
| 1552 | AC_DEFINE(HAVE___PROGNAME) |
| 1553 | fi |
| 1554 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 1555 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
| 1556 | AC_TRY_LINK([ |
| 1557 | #include <stdio.h> |
| 1558 | ], |
| 1559 | [ printf("%s", __FUNCTION__); ], |
| 1560 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
| 1561 | [ ac_cv_cc_implements___FUNCTION__="no" ] |
| 1562 | ) |
| 1563 | ]) |
| 1564 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
| 1565 | AC_DEFINE(HAVE___FUNCTION__) |
| 1566 | fi |
| 1567 | |
| 1568 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
| 1569 | AC_TRY_LINK([ |
| 1570 | #include <stdio.h> |
| 1571 | ], |
| 1572 | [ printf("%s", __func__); ], |
| 1573 | [ ac_cv_cc_implements___func__="yes" ], |
| 1574 | [ ac_cv_cc_implements___func__="no" ] |
| 1575 | ) |
| 1576 | ]) |
| 1577 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
| 1578 | AC_DEFINE(HAVE___func__) |
| 1579 | fi |
| 1580 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 1581 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 1582 | ac_cv_have_getopt_optreset, [ |
| 1583 | AC_TRY_LINK( |
| 1584 | [ |
| 1585 | #include <getopt.h> |
| 1586 | ], |
| 1587 | [ extern int optreset; optreset = 0; ], |
| 1588 | [ ac_cv_have_getopt_optreset="yes" ], |
| 1589 | [ ac_cv_have_getopt_optreset="no" ] |
| 1590 | ) |
| 1591 | ]) |
| 1592 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
| 1593 | AC_DEFINE(HAVE_GETOPT_OPTRESET) |
| 1594 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1595 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 1596 | AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ |
| 1597 | AC_TRY_LINK([], |
| 1598 | [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);], |
| 1599 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
| 1600 | [ ac_cv_libc_defines_sys_errlist="no" ] |
| 1601 | ) |
| 1602 | ]) |
| 1603 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
| 1604 | AC_DEFINE(HAVE_SYS_ERRLIST) |
| 1605 | fi |
| 1606 | |
| 1607 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 1608 | AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ |
| 1609 | AC_TRY_LINK([], |
| 1610 | [ extern int sys_nerr; printf("%i", sys_nerr);], |
| 1611 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
| 1612 | [ ac_cv_libc_defines_sys_nerr="no" ] |
| 1613 | ) |
| 1614 | ]) |
| 1615 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
| 1616 | AC_DEFINE(HAVE_SYS_NERR) |
| 1617 | fi |
| 1618 | |
Damien Miller | 85de580 | 2001-09-18 14:01:11 +1000 | [diff] [blame] | 1619 | SCARD_MSG="no" |
Ben Lindstrom | a42694f | 2002-04-05 16:11:45 +0000 | [diff] [blame] | 1620 | |
| 1621 | # Check whether user wants sectok support |
| 1622 | AC_ARG_WITH(sectok, |
| 1623 | [ --with-sectok Enable smartcard support using libsectok], |
Damien Miller | 85de580 | 2001-09-18 14:01:11 +1000 | [diff] [blame] | 1624 | [ |
| 1625 | if test "x$withval" != "xno" ; then |
| 1626 | if test "x$withval" != "xyes" ; then |
| 1627 | CPPFLAGS="$CPPFLAGS -I${withval}" |
| 1628 | LDFLAGS="$LDFLAGS -L${withval}" |
| 1629 | if test ! -z "$need_dash_r" ; then |
| 1630 | LDFLAGS="$LDFLAGS -R${withval}" |
| 1631 | fi |
| 1632 | if test ! -z "$blibpath" ; then |
| 1633 | blibpath="$blibpath:${withval}" |
| 1634 | fi |
| 1635 | fi |
| 1636 | AC_CHECK_HEADERS(sectok.h) |
| 1637 | if test "$ac_cv_header_sectok_h" != yes; then |
| 1638 | AC_MSG_ERROR(Can't find sectok.h) |
| 1639 | fi |
| 1640 | AC_CHECK_LIB(sectok, sectok_open) |
| 1641 | if test "$ac_cv_lib_sectok_sectok_open" != yes; then |
| 1642 | AC_MSG_ERROR(Can't find libsectok) |
| 1643 | fi |
| 1644 | AC_DEFINE(SMARTCARD) |
Ben Lindstrom | a42694f | 2002-04-05 16:11:45 +0000 | [diff] [blame] | 1645 | AC_DEFINE(USE_SECTOK) |
| 1646 | SCARD_MSG="yes, using sectok" |
| 1647 | fi |
| 1648 | ] |
| 1649 | ) |
| 1650 | |
| 1651 | # Check whether user wants OpenSC support |
| 1652 | AC_ARG_WITH(opensc, |
Damien Miller | f6195f2 | 2002-04-23 22:48:46 +1000 | [diff] [blame] | 1653 | AC_HELP_STRING([--with-opensc=PFX], |
| 1654 | [Enable smartcard support using OpenSC]), |
| 1655 | opensc_config_prefix="$withval", opensc_config_prefix="") |
| 1656 | if test x$opensc_config_prefix != x ; then |
| 1657 | OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config |
| 1658 | AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no) |
| 1659 | if test "$OPENSC_CONFIG" != "no"; then |
| 1660 | LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags` |
| 1661 | LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs` |
| 1662 | CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS" |
| 1663 | LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS" |
| 1664 | AC_DEFINE(SMARTCARD) |
| 1665 | AC_DEFINE(USE_OPENSC) |
| 1666 | SCARD_MSG="yes, using OpenSC" |
| 1667 | fi |
| 1668 | fi |
Damien Miller | 85de580 | 2001-09-18 14:01:11 +1000 | [diff] [blame] | 1669 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 1670 | # Check whether user wants Kerberos 5 support |
| 1671 | KRB5_MSG="no" |
| 1672 | AC_ARG_WITH(kerberos5, |
| 1673 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
| 1674 | [ |
| 1675 | if test "x$withval" != "xno" ; then |
| 1676 | if test "x$withval" = "xyes" ; then |
| 1677 | KRB5ROOT="/usr/local" |
| 1678 | else |
| 1679 | KRB5ROOT=${withval} |
| 1680 | fi |
| 1681 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
| 1682 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
| 1683 | AC_DEFINE(KRB5) |
| 1684 | KRB5_MSG="yes" |
| 1685 | AC_MSG_CHECKING(whether we are using Heimdal) |
| 1686 | AC_TRY_COMPILE([ #include <krb5.h> ], |
| 1687 | [ char *tmp = heimdal_version; ], |
| 1688 | [ AC_MSG_RESULT(yes) |
| 1689 | AC_DEFINE(HEIMDAL) |
| 1690 | K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken" |
| 1691 | ], |
| 1692 | [ AC_MSG_RESULT(no) |
| 1693 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
| 1694 | ] |
| 1695 | ) |
| 1696 | if test ! -z "$need_dash_r" ; then |
| 1697 | LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" |
| 1698 | fi |
| 1699 | if test ! -z "$blibpath" ; then |
| 1700 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 1701 | fi |
| 1702 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 1703 | |
| 1704 | KRB5=yes |
| 1705 | fi |
| 1706 | ] |
| 1707 | ) |
| 1708 | # Check whether user wants Kerberos 4 support |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1709 | KRB4_MSG="no" |
| 1710 | AC_ARG_WITH(kerberos4, |
| 1711 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
| 1712 | [ |
| 1713 | if test "x$withval" != "xno" ; then |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1714 | if test "x$withval" != "xyes" ; then |
| 1715 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1716 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1717 | if test ! -z "$need_dash_r" ; then |
| 1718 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
| 1719 | fi |
| 1720 | if test ! -z "$blibpath" ; then |
| 1721 | blibpath="$blibpath:${withval}/lib" |
| 1722 | fi |
| 1723 | else |
| 1724 | if test -d /usr/include/kerberosIV ; then |
| 1725 | CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV" |
| 1726 | fi |
| 1727 | fi |
| 1728 | |
| 1729 | AC_CHECK_HEADERS(krb.h) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1730 | if test "$ac_cv_header_krb_h" != yes; then |
| 1731 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 1732 | fi |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1733 | AC_CHECK_LIB(krb, main) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1734 | if test "$ac_cv_lib_krb_main" != yes; then |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1735 | AC_CHECK_LIB(krb4, main) |
| 1736 | if test "$ac_cv_lib_krb4_main" != yes; then |
| 1737 | AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail]) |
| 1738 | else |
| 1739 | KLIBS="-lkrb4" |
| 1740 | fi |
| 1741 | else |
| 1742 | KLIBS="-lkrb" |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1743 | fi |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1744 | AC_CHECK_LIB(des, des_cbc_encrypt) |
| 1745 | if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then |
| 1746 | AC_CHECK_LIB(des425, des_cbc_encrypt) |
| 1747 | if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then |
| 1748 | AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail]) |
| 1749 | else |
| 1750 | KLIBS="-ldes425" |
| 1751 | fi |
| 1752 | else |
| 1753 | KLIBS="-ldes" |
| 1754 | fi |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1755 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 1756 | KRB4=yes |
| 1757 | KRB4_MSG="yes" |
| 1758 | AC_DEFINE(KRB4) |
| 1759 | fi |
| 1760 | ] |
| 1761 | ) |
| 1762 | |
| 1763 | # Check whether user wants AFS support |
| 1764 | AFS_MSG="no" |
| 1765 | AC_ARG_WITH(afs, |
| 1766 | [ --with-afs=PATH Enable AFS support], |
| 1767 | [ |
| 1768 | if test "x$withval" != "xno" ; then |
| 1769 | |
| 1770 | if test "x$withval" != "xyes" ; then |
| 1771 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1772 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1773 | fi |
| 1774 | |
| 1775 | if test -z "$KRB4" ; then |
| 1776 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 1777 | fi |
| 1778 | |
| 1779 | LIBS="-lkafs $LIBS" |
| 1780 | if test ! -z "$AFS_LIBS" ; then |
| 1781 | LIBS="$LIBS $AFS_LIBS" |
| 1782 | fi |
| 1783 | AC_DEFINE(AFS) |
| 1784 | AFS_MSG="yes" |
| 1785 | fi |
| 1786 | ] |
| 1787 | ) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 1788 | LIBS="$LIBS $KLIBS $K5LIBS" |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1789 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1790 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1791 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 1792 | PRIVSEP_PATH=/var/empty |
| 1793 | AC_ARG_WITH(privsep-path, |
Damien Miller | 74cc5bb | 2002-05-22 11:02:15 +1000 | [diff] [blame] | 1794 | [ --with-privsep-path=xxx Path for privilege separation chroot ], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 1795 | [ |
| 1796 | if test "x$withval" != "$no" ; then |
| 1797 | PRIVSEP_PATH=$withval |
| 1798 | fi |
| 1799 | ] |
| 1800 | ) |
| 1801 | AC_SUBST(PRIVSEP_PATH) |
| 1802 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1803 | AC_ARG_WITH(xauth, |
| 1804 | [ --with-xauth=PATH Specify path to xauth program ], |
| 1805 | [ |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 1806 | if test "x$withval" != "xno" ; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1807 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1808 | fi |
| 1809 | ], |
| 1810 | [ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1811 | AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 1812 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1813 | xauth_path="/usr/openwin/bin/xauth" |
| 1814 | fi |
| 1815 | ] |
| 1816 | ) |
| 1817 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 1818 | if test -z "$xauth_path" ; then |
| 1819 | XAUTH_PATH="undefined" |
| 1820 | AC_SUBST(XAUTH_PATH) |
| 1821 | else |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1822 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 1823 | XAUTH_PATH=$xauth_path |
| 1824 | AC_SUBST(XAUTH_PATH) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1825 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1826 | |
| 1827 | # Check for mail directory (last resort if we cannot get it from headers) |
| 1828 | if test ! -z "$MAIL" ; then |
| 1829 | maildir=`dirname $MAIL` |
| 1830 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 1831 | fi |
| 1832 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1833 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 1834 | if test "x$disable_ptmx_check" != "xyes" ; then |
| 1835 | AC_CHECK_FILE("/dev/ptmx", |
| 1836 | [ |
| 1837 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 1838 | have_dev_ptmx=1 |
| 1839 | ] |
| 1840 | ) |
| 1841 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1842 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 1843 | AC_CHECK_FILE("/dev/ptc", |
| 1844 | [ |
| 1845 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 1846 | have_dev_ptc=1 |
| 1847 | ] |
| 1848 | ) |
| 1849 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1850 | # Options from here on. Some of these are preset by platform above |
Ben Lindstrom | 9841b0a | 2001-06-09 02:26:58 +0000 | [diff] [blame] | 1851 | AC_ARG_WITH(mantype, |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 1852 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1853 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 1854 | case "$withval" in |
| 1855 | man|cat|doc) |
| 1856 | MANTYPE=$withval |
| 1857 | ;; |
| 1858 | *) |
| 1859 | AC_MSG_ERROR(invalid man type: $withval) |
| 1860 | ;; |
| 1861 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1862 | ] |
| 1863 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1864 | if test -z "$MANTYPE"; then |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 1865 | AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1866 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 1867 | MANTYPE=doc |
| 1868 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 1869 | MANTYPE=man |
| 1870 | else |
| 1871 | MANTYPE=cat |
| 1872 | fi |
| 1873 | fi |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1874 | AC_SUBST(MANTYPE) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1875 | if test "$MANTYPE" = "doc"; then |
| 1876 | mansubdir=man; |
| 1877 | else |
| 1878 | mansubdir=$MANTYPE; |
| 1879 | fi |
| 1880 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1881 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1882 | # Check whether to enable MD5 passwords |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1883 | MD5_MSG="no" |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 1884 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 1885 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1886 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 1887 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1888 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1889 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1890 | fi |
| 1891 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 1892 | ) |
| 1893 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1894 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1895 | AC_ARG_WITH(shadow, |
| 1896 | [ --without-shadow Disable shadow password support], |
| 1897 | [ |
| 1898 | if test "x$withval" = "xno" ; then |
| 1899 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 1900 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1901 | fi |
| 1902 | ] |
| 1903 | ) |
| 1904 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 1905 | if test -z "$disable_shadow" ; then |
| 1906 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
| 1907 | AC_TRY_COMPILE( |
| 1908 | [ |
| 1909 | #include <sys/types.h> |
| 1910 | #include <shadow.h> |
| 1911 | struct spwd sp; |
| 1912 | ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ], |
| 1913 | [ sp_expire_available=yes ], [] |
| 1914 | ) |
| 1915 | |
| 1916 | if test "x$sp_expire_available" = "xyes" ; then |
| 1917 | AC_MSG_RESULT(yes) |
| 1918 | AC_DEFINE(HAS_SHADOW_EXPIRE) |
| 1919 | else |
| 1920 | AC_MSG_RESULT(no) |
| 1921 | fi |
| 1922 | fi |
| 1923 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1924 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 1925 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 1926 | DISPLAY_HACK_MSG="yes" |
| 1927 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 1928 | else |
| 1929 | DISPLAY_HACK_MSG="no" |
| 1930 | AC_ARG_WITH(ipaddr-display, |
| 1931 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 1932 | [ |
| 1933 | if test "x$withval" != "xno" ; then |
| 1934 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 1935 | DISPLAY_HACK_MSG="yes" |
| 1936 | fi |
| 1937 | ] |
| 1938 | ) |
| 1939 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1940 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 1941 | dnl BSD systems use /etc/login.conf so --with-default-path= has no effect |
| 1942 | if test $ac_cv_func_login_getcapbool = "yes" -a \ |
| 1943 | $ac_cv_header_login_cap_h = "yes" ; then |
| 1944 | USES_LOGIN_CONF=yes |
| 1945 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1946 | # Whether to mess with the default path |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1947 | SERVER_PATH_MSG="(default)" |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 1948 | AC_ARG_WITH(default-path, |
Damien Miller | f71d2a5 | 2002-05-13 15:14:08 +1000 | [diff] [blame] | 1949 | [ --with-default-path= Specify default \$PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1950 | [ |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 1951 | if test "$USES_LOGIN_CONF" = "yes" ; then |
| 1952 | AC_MSG_WARN([ |
| 1953 | --with-default-path=PATH has no effect on this system. |
| 1954 | Edit /etc/login.conf instead.]) |
| 1955 | elif test "x$withval" != "xno" ; then |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1956 | user_path="$withval" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1957 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1958 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1959 | ], |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 1960 | [ if test "$USES_LOGIN_CONF" = "yes" ; then |
| 1961 | AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf]) |
| 1962 | else |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1963 | AC_TRY_RUN( |
| 1964 | [ |
| 1965 | /* find out what STDPATH is */ |
| 1966 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1967 | #ifdef HAVE_PATHS_H |
| 1968 | # include <paths.h> |
| 1969 | #endif |
| 1970 | #ifndef _PATH_STDPATH |
| 1971 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 1972 | #endif |
| 1973 | #include <sys/types.h> |
| 1974 | #include <sys/stat.h> |
| 1975 | #include <fcntl.h> |
| 1976 | #define DATA "conftest.stdpath" |
| 1977 | |
| 1978 | main() |
| 1979 | { |
| 1980 | FILE *fd; |
| 1981 | int rc; |
| 1982 | |
| 1983 | fd = fopen(DATA,"w"); |
| 1984 | if(fd == NULL) |
| 1985 | exit(1); |
| 1986 | |
| 1987 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 1988 | exit(1); |
| 1989 | |
| 1990 | exit(0); |
| 1991 | } |
| 1992 | ], [ user_path=`cat conftest.stdpath` ], |
| 1993 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 1994 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 1995 | ) |
| 1996 | # make sure $bindir is in USER_PATH so scp will work |
| 1997 | t_bindir=`eval echo ${bindir}` |
| 1998 | case $t_bindir in |
| 1999 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 2000 | esac |
| 2001 | case $t_bindir in |
| 2002 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 2003 | esac |
| 2004 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 2005 | if test $? -ne 0 ; then |
| 2006 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 2007 | if test $? -ne 0 ; then |
| 2008 | user_path=$user_path:$t_bindir |
| 2009 | AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work) |
| 2010 | fi |
| 2011 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2012 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 2013 | ) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2014 | if test "$USES_LOGIN_CONF" != "yes" ; then |
| 2015 | AC_DEFINE_UNQUOTED(USER_PATH, "$user_path") |
| 2016 | AC_SUBST(user_path) |
| 2017 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 2018 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 2019 | # Set superuser path separately to user path |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 2020 | AC_ARG_WITH(superuser-path, |
| 2021 | [ --with-superuser-path= Specify different path for super-user], |
| 2022 | [ |
| 2023 | if test "x$withval" != "xno" ; then |
| 2024 | AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval") |
| 2025 | superuser_path=$withval |
| 2026 | fi |
| 2027 | ] |
| 2028 | ) |
| 2029 | |
| 2030 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2031 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2032 | IPV4_HACK_MSG="no" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 2033 | AC_ARG_WITH(ipv4-default, |
| 2034 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 2035 | [ |
| 2036 | if test "x$withval" != "xno" ; then |
| 2037 | AC_DEFINE(IPV4_DEFAULT) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2038 | IPV4_HACK_MSG="yes" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 2039 | fi |
| 2040 | ] |
| 2041 | ) |
| 2042 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2043 | AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses]) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2044 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 2045 | AC_ARG_WITH(4in6, |
| 2046 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 2047 | [ |
| 2048 | if test "x$withval" != "xno" ; then |
| 2049 | AC_MSG_RESULT(yes) |
| 2050 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2051 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 2052 | else |
| 2053 | AC_MSG_RESULT(no) |
| 2054 | fi |
| 2055 | ],[ |
| 2056 | if test "x$inet6_default_4in6" = "xyes"; then |
| 2057 | AC_MSG_RESULT([yes (default)]) |
| 2058 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2059 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 2060 | else |
| 2061 | AC_MSG_RESULT([no (default)]) |
| 2062 | fi |
| 2063 | ] |
| 2064 | ) |
| 2065 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2066 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2067 | BSD_AUTH_MSG=no |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2068 | AC_ARG_WITH(bsd-auth, |
| 2069 | [ --with-bsd-auth Enable BSD auth support], |
| 2070 | [ |
| 2071 | if test "x$withval" != "xno" ; then |
| 2072 | AC_DEFINE(BSD_AUTH) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2073 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2074 | fi |
| 2075 | ] |
| 2076 | ) |
| 2077 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2078 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 2079 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 2080 | # make sure the directory exists |
| 2081 | if test ! -d $piddir ; then |
| 2082 | piddir=`eval echo ${sysconfdir}` |
| 2083 | case $piddir in |
| 2084 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 2085 | esac |
| 2086 | fi |
| 2087 | |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 2088 | AC_ARG_WITH(pid-dir, |
| 2089 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 2090 | [ |
| 2091 | if test "x$withval" != "xno" ; then |
| 2092 | piddir=$withval |
| 2093 | if test ! -d $piddir ; then |
| 2094 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 2095 | fi |
| 2096 | fi |
| 2097 | ] |
| 2098 | ) |
| 2099 | |
Ben Lindstrom | 226cfa0 | 2001-01-22 05:34:40 +0000 | [diff] [blame] | 2100 | AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 2101 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 2102 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2103 | dnl allow user to disable some login recording features |
| 2104 | AC_ARG_ENABLE(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2105 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2106 | [ AC_DEFINE(DISABLE_LASTLOG) ] |
| 2107 | ) |
| 2108 | AC_ARG_ENABLE(utmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2109 | [ --disable-utmp disable use of utmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2110 | [ AC_DEFINE(DISABLE_UTMP) ] |
| 2111 | ) |
| 2112 | AC_ARG_ENABLE(utmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2113 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2114 | [ AC_DEFINE(DISABLE_UTMPX) ] |
| 2115 | ) |
| 2116 | AC_ARG_ENABLE(wtmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2117 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2118 | [ AC_DEFINE(DISABLE_WTMP) ] |
| 2119 | ) |
| 2120 | AC_ARG_ENABLE(wtmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2121 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2122 | [ AC_DEFINE(DISABLE_WTMPX) ] |
| 2123 | ) |
| 2124 | AC_ARG_ENABLE(libutil, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2125 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2126 | [ AC_DEFINE(DISABLE_LOGIN) ] |
| 2127 | ) |
| 2128 | AC_ARG_ENABLE(pututline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2129 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2130 | [ AC_DEFINE(DISABLE_PUTUTLINE) ] |
| 2131 | ) |
| 2132 | AC_ARG_ENABLE(pututxline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2133 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2134 | [ AC_DEFINE(DISABLE_PUTUTXLINE) ] |
| 2135 | ) |
| 2136 | AC_ARG_WITH(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2137 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 2138 | [ |
| 2139 | if test "x$withval" = "xno" ; then |
| 2140 | AC_DEFINE(DISABLE_LASTLOG) |
| 2141 | else |
| 2142 | conf_lastlog_location=$withval |
| 2143 | fi |
| 2144 | ] |
| 2145 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2146 | |
| 2147 | dnl lastlog, [uw]tmpx? detection |
| 2148 | dnl NOTE: set the paths in the platform section to avoid the |
| 2149 | dnl need for command-line parameters |
| 2150 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 2151 | |
| 2152 | dnl lastlog detection |
| 2153 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 2154 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
| 2155 | AC_TRY_COMPILE([ |
| 2156 | #include <sys/types.h> |
| 2157 | #include <utmp.h> |
| 2158 | #ifdef HAVE_LASTLOG_H |
| 2159 | # include <lastlog.h> |
| 2160 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2161 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2162 | # include <paths.h> |
| 2163 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2164 | #ifdef HAVE_LOGIN_H |
| 2165 | # include <login.h> |
| 2166 | #endif |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2167 | ], |
| 2168 | [ char *lastlog = LASTLOG_FILE; ], |
| 2169 | [ AC_MSG_RESULT(yes) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2170 | [ |
| 2171 | AC_MSG_RESULT(no) |
| 2172 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
| 2173 | AC_TRY_COMPILE([ |
| 2174 | #include <sys/types.h> |
| 2175 | #include <utmp.h> |
| 2176 | #ifdef HAVE_LASTLOG_H |
| 2177 | # include <lastlog.h> |
| 2178 | #endif |
| 2179 | #ifdef HAVE_PATHS_H |
| 2180 | # include <paths.h> |
| 2181 | #endif |
| 2182 | ], |
| 2183 | [ char *lastlog = _PATH_LASTLOG; ], |
| 2184 | [ AC_MSG_RESULT(yes) ], |
| 2185 | [ |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 2186 | AC_MSG_RESULT(no) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2187 | system_lastlog_path=no |
| 2188 | ]) |
| 2189 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2190 | ) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2191 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2192 | if test -z "$conf_lastlog_location"; then |
| 2193 | if test x"$system_lastlog_path" = x"no" ; then |
| 2194 | 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] | 2195 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2196 | conf_lastlog_location=$f |
| 2197 | fi |
| 2198 | done |
| 2199 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 2200 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 2201 | 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] | 2202 | fi |
| 2203 | fi |
| 2204 | fi |
| 2205 | |
| 2206 | if test -n "$conf_lastlog_location"; then |
| 2207 | AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location") |
| 2208 | fi |
| 2209 | |
| 2210 | dnl utmp detection |
| 2211 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
| 2212 | AC_TRY_COMPILE([ |
| 2213 | #include <sys/types.h> |
| 2214 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2215 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2216 | # include <paths.h> |
| 2217 | #endif |
| 2218 | ], |
| 2219 | [ char *utmp = UTMP_FILE; ], |
| 2220 | [ AC_MSG_RESULT(yes) ], |
| 2221 | [ AC_MSG_RESULT(no) |
| 2222 | system_utmp_path=no ] |
| 2223 | ) |
| 2224 | if test -z "$conf_utmp_location"; then |
| 2225 | if test x"$system_utmp_path" = x"no" ; then |
| 2226 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 2227 | if test -f $f ; then |
| 2228 | conf_utmp_location=$f |
| 2229 | fi |
| 2230 | done |
| 2231 | if test -z "$conf_utmp_location"; then |
| 2232 | AC_DEFINE(DISABLE_UTMP) |
| 2233 | fi |
| 2234 | fi |
| 2235 | fi |
| 2236 | if test -n "$conf_utmp_location"; then |
| 2237 | AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location") |
| 2238 | fi |
| 2239 | |
| 2240 | dnl wtmp detection |
| 2241 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
| 2242 | AC_TRY_COMPILE([ |
| 2243 | #include <sys/types.h> |
| 2244 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2245 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2246 | # include <paths.h> |
| 2247 | #endif |
| 2248 | ], |
| 2249 | [ char *wtmp = WTMP_FILE; ], |
| 2250 | [ AC_MSG_RESULT(yes) ], |
| 2251 | [ AC_MSG_RESULT(no) |
| 2252 | system_wtmp_path=no ] |
| 2253 | ) |
| 2254 | if test -z "$conf_wtmp_location"; then |
| 2255 | if test x"$system_wtmp_path" = x"no" ; then |
| 2256 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 2257 | if test -f $f ; then |
| 2258 | conf_wtmp_location=$f |
| 2259 | fi |
| 2260 | done |
| 2261 | if test -z "$conf_wtmp_location"; then |
| 2262 | AC_DEFINE(DISABLE_WTMP) |
| 2263 | fi |
| 2264 | fi |
| 2265 | fi |
| 2266 | if test -n "$conf_wtmp_location"; then |
| 2267 | AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location") |
| 2268 | fi |
| 2269 | |
| 2270 | |
| 2271 | dnl utmpx detection - I don't know any system so perverse as to require |
| 2272 | dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out |
| 2273 | dnl there, though. |
| 2274 | AC_MSG_CHECKING([if your system defines UTMPX_FILE]) |
| 2275 | AC_TRY_COMPILE([ |
| 2276 | #include <sys/types.h> |
| 2277 | #include <utmp.h> |
| 2278 | #ifdef HAVE_UTMPX_H |
| 2279 | #include <utmpx.h> |
| 2280 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2281 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2282 | # include <paths.h> |
| 2283 | #endif |
| 2284 | ], |
| 2285 | [ char *utmpx = UTMPX_FILE; ], |
| 2286 | [ AC_MSG_RESULT(yes) ], |
| 2287 | [ AC_MSG_RESULT(no) |
| 2288 | system_utmpx_path=no ] |
| 2289 | ) |
| 2290 | if test -z "$conf_utmpx_location"; then |
| 2291 | if test x"$system_utmpx_path" = x"no" ; then |
| 2292 | AC_DEFINE(DISABLE_UTMPX) |
| 2293 | fi |
| 2294 | else |
| 2295 | AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location") |
| 2296 | fi |
| 2297 | |
| 2298 | dnl wtmpx detection |
| 2299 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
| 2300 | AC_TRY_COMPILE([ |
| 2301 | #include <sys/types.h> |
| 2302 | #include <utmp.h> |
| 2303 | #ifdef HAVE_UTMPX_H |
| 2304 | #include <utmpx.h> |
| 2305 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2306 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2307 | # include <paths.h> |
| 2308 | #endif |
| 2309 | ], |
| 2310 | [ char *wtmpx = WTMPX_FILE; ], |
| 2311 | [ AC_MSG_RESULT(yes) ], |
| 2312 | [ AC_MSG_RESULT(no) |
| 2313 | system_wtmpx_path=no ] |
| 2314 | ) |
| 2315 | if test -z "$conf_wtmpx_location"; then |
| 2316 | if test x"$system_wtmpx_path" = x"no" ; then |
| 2317 | AC_DEFINE(DISABLE_WTMPX) |
| 2318 | fi |
| 2319 | else |
| 2320 | AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location") |
| 2321 | fi |
| 2322 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 2323 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 2324 | if test ! -z "$blibpath" ; then |
| 2325 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 2326 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 2327 | fi |
| 2328 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2329 | dnl remove pam and dl because they are in $LIBPAM |
| 2330 | if test "$PAM_MSG" = yes ; then |
Tim Rice | 7d2d1f1 | 2002-02-26 22:05:11 -0800 | [diff] [blame] | 2331 | LIBS=`echo $LIBS | sed 's/-lpam //'` |
| 2332 | fi |
| 2333 | if test "$ac_cv_lib_pam_pam_set_item" = yes ; then |
| 2334 | LIBS=`echo $LIBS | sed 's/-ldl //'` |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2335 | fi |
| 2336 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 2337 | AC_EXEEXT |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 2338 | AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds]) |
| 2339 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 2340 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2341 | # Print summary of options |
| 2342 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2343 | # Someone please show me a better way :) |
| 2344 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 2345 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 2346 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 2347 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 2348 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 2349 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2350 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2351 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 2352 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 2353 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2354 | |
| 2355 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 2356 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2357 | echo " User binaries: $B" |
| 2358 | echo " System binaries: $C" |
| 2359 | echo " Configuration files: $D" |
| 2360 | echo " Askpass program: $E" |
| 2361 | echo " Manual pages: $F" |
| 2362 | echo " PID file: $G" |
| 2363 | echo " Privilege separation chroot path: $H" |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2364 | if test "$USES_LOGIN_CONF" = "yes" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2365 | echo " At runtime, sshd will use the path defined in /etc/login.conf" |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2366 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2367 | echo " sshd default user PATH: $I" |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2368 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 2369 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2370 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 2371 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2372 | echo " Manpage format: $MANTYPE" |
| 2373 | echo " PAM support: ${PAM_MSG}" |
| 2374 | echo " KerberosIV support: $KRB4_MSG" |
| 2375 | echo " KerberosV support: $KRB5_MSG" |
| 2376 | echo " Smartcard support: $SCARD_MSG" |
| 2377 | echo " AFS support: $AFS_MSG" |
| 2378 | echo " S/KEY support: $SKEY_MSG" |
| 2379 | echo " TCP Wrappers support: $TCPW_MSG" |
| 2380 | echo " MD5 password support: $MD5_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 2381 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2382 | echo " Use IPv4 by default hack: $IPV4_HACK_MSG" |
| 2383 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 2384 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 2385 | echo " Random number source: $RAND_MSG" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2386 | if test ! -z "$USE_RAND_HELPER" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2387 | echo " ssh-rand-helper collects from: $RAND_HELPER_MSG" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2388 | fi |
| 2389 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2390 | echo "" |
| 2391 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 2392 | echo " Host: ${host}" |
| 2393 | echo " Compiler: ${CC}" |
| 2394 | echo " Compiler flags: ${CFLAGS}" |
| 2395 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 2396 | echo " Linker flags: ${LDFLAGS}" |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2397 | echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2398 | |
| 2399 | echo "" |
| 2400 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 2401 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2402 | echo "PAM is enabled. You may need to install a PAM control file " |
| 2403 | echo "for sshd, otherwise password authentication may fail. " |
| 2404 | echo "Example PAM control files can be found in the contrib/ " |
| 2405 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 2406 | echo "" |
| 2407 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 2408 | |
| 2409 | if test ! -z "$NO_SFTP"; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2410 | echo "sftp-server will be disabled. Your compiler does not " |
| 2411 | echo "support 64bit integers." |
| 2412 | echo "" |
| 2413 | fi |
| 2414 | |
| 2415 | if test ! -z "$RAND_HELPER_CMDHASH" ; then |
| 2416 | echo "WARNING: you are using the builtin random number collection " |
| 2417 | echo "service. Please read WARNING.RNG and request that your OS " |
| 2418 | echo "vendor includes kernel-based random number collection in " |
| 2419 | echo "future versions of your OS." |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 2420 | echo "" |
| 2421 | fi |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2422 | |