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