Ben Lindstrom | 9841b0a | 2001-06-09 02:26:58 +0000 | [diff] [blame] | 1 | # $Id: configure.in,v 1.289 2001/06/09 02:26:59 mouring Exp $ |
Damien Miller | e9cf357 | 2001-02-09 12:55:35 +1100 | [diff] [blame] | 2 | |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 3 | AC_INIT(ssh.c) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 4 | |
| 5 | AC_CONFIG_HEADER(config.h) |
Damien Miller | 856799b | 2000-03-15 21:18:10 +1100 | [diff] [blame] | 6 | AC_PROG_CC |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 7 | AC_CANONICAL_HOST |
Damien Miller | 4df5c76 | 2001-02-28 08:14:22 +1100 | [diff] [blame] | 8 | AC_C_BIGENDIAN |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 9 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 10 | # Checks for programs. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 11 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 12 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 13 | AC_PROG_INSTALL |
Ben Lindstrom | 582d398 | 2001-02-06 22:54:30 +0000 | [diff] [blame] | 14 | AC_PATH_PROG(AR, ar) |
Tim Rice | b8fbb8e | 2001-04-21 14:31:52 -0700 | [diff] [blame] | 15 | AC_PATH_PROGS(PERL, perl5 perl) |
Damien Miller | e79334a | 1999-12-29 10:03:37 +1100 | [diff] [blame] | 16 | AC_SUBST(PERL) |
Damien Miller | 8d1fd57 | 2000-05-17 21:34:07 +1000 | [diff] [blame] | 17 | AC_PATH_PROG(ENT, ent) |
| 18 | AC_SUBST(ENT) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 19 | AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin) |
Damien Miller | 4864e8f | 2001-02-08 10:07:08 +1100 | [diff] [blame] | 20 | AC_PATH_PROG(TEST_MINUS_S_SH, bash) |
| 21 | AC_PATH_PROG(TEST_MINUS_S_SH, ksh) |
| 22 | AC_PATH_PROG(TEST_MINUS_S_SH, sh) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 23 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 24 | if test -z "$AR" ; then |
| 25 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 26 | fi |
| 27 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 28 | # Use LOGIN_PROGRAM from environment if possible |
| 29 | if test ! -z "$LOGIN_PROGRAM" ; then |
| 30 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM") |
| 31 | else |
| 32 | # Search for login |
| 33 | AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login) |
| 34 | if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then |
| 35 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK") |
| 36 | fi |
| 37 | fi |
| 38 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 39 | if test -z "$LD" ; then |
| 40 | LD=$CC |
| 41 | fi |
| 42 | AC_SUBST(LD) |
| 43 | |
| 44 | # C Compiler features |
| 45 | AC_C_INLINE |
| 46 | if test "$GCC" = "yes"; then |
| 47 | CFLAGS="$CFLAGS -Wall" |
| 48 | fi |
| 49 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 50 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 51 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 52 | *-*-aix*) |
| 53 | AFS_LIBS="-lld" |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 54 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 55 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 56 | if (test "$LD" != "gcc" && test -z "$blibpath"); then |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 57 | blibpath="/usr/lib:/lib:/usr/local/lib" |
| 58 | fi |
Damien Miller | d2c208a | 2000-05-17 22:00:02 +1000 | [diff] [blame] | 59 | AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)]) |
Damien Miller | eca71f8 | 2000-01-20 22:38:27 +1100 | [diff] [blame] | 60 | AC_DEFINE(BROKEN_GETADDRINFO) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 61 | dnl AIX handles lastlog as part of its login message |
| 62 | AC_DEFINE(DISABLE_LASTLOG) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 63 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 64 | *-*-cygwin*) |
Damien Miller | ef767ac | 2000-10-17 23:14:08 +1100 | [diff] [blame] | 65 | LIBS="$LIBS -lregex /usr/lib/textmode.o" |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 66 | AC_DEFINE(HAVE_CYGWIN) |
Ben Lindstrom | ca60a9b | 2001-05-17 03:32:50 +0000 | [diff] [blame] | 67 | AC_DEFINE(USE_PIPES) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 68 | AC_DEFINE(DISABLE_SHADOW) |
| 69 | AC_DEFINE(IPV4_DEFAULT) |
| 70 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Ben Lindstrom | 38e6093 | 2001-02-24 00:55:04 +0000 | [diff] [blame] | 71 | AC_DEFINE(NO_X11_UNIX_SOCKETS) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 72 | no_libsocket=1 |
| 73 | no_libnsl=1 |
| 74 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 75 | *-*-dgux*) |
| 76 | AC_DEFINE(IP_TOS_IS_BROKEN) |
| 77 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 78 | *-*-hpux10*) |
| 79 | if test -z "$GCC"; then |
Damien Miller | fda78d9 | 2000-05-20 15:33:44 +1000 | [diff] [blame] | 80 | CFLAGS="$CFLAGS -Ae" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 81 | fi |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 82 | CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 83 | IPADDR_IN_DISPLAY=yes |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 84 | AC_DEFINE(USE_PIPES) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 85 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame] | 86 | AC_DEFINE(DISABLE_UTMP) |
Kevin Steves | 8848b24 | 2000-10-18 13:11:44 +0000 | [diff] [blame] | 87 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 88 | LIBS="$LIBS -lsec" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 89 | ;; |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 90 | *-*-hpux11*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 91 | CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 92 | IPADDR_IN_DISPLAY=yes |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 93 | AC_DEFINE(PAM_SUN_CODEBASE) |
Damien Miller | 5552d7a | 2000-08-30 09:53:24 +1100 | [diff] [blame] | 94 | AC_DEFINE(USE_PIPES) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 95 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame] | 96 | AC_DEFINE(DISABLE_UTMP) |
Kevin Steves | 8848b24 | 2000-10-18 13:11:44 +0000 | [diff] [blame] | 97 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 98 | LIBS="$LIBS -lsec" |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 99 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 100 | *-*-irix5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 101 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 102 | LDFLAGS="$LDFLAGS" |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 103 | PATH="$PATH:/usr/etc" |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 104 | no_libsocket=1 |
| 105 | no_libnsl=1 |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 106 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 107 | ;; |
| 108 | *-*-irix6*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 109 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 110 | LDFLAGS="$LDFLAGS" |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 111 | PATH="$PATH:/usr/etc" |
Damien Miller | 91606b1 | 2000-06-28 08:22:29 +1000 | [diff] [blame] | 112 | AC_DEFINE(WITH_IRIX_ARRAY) |
| 113 | AC_DEFINE(WITH_IRIX_PROJECT) |
| 114 | AC_DEFINE(WITH_IRIX_AUDIT) |
Ben Lindstrom | 4a1d916 | 2000-11-21 10:45:31 +0000 | [diff] [blame] | 115 | AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 116 | no_libsocket=1 |
| 117 | no_libnsl=1 |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 118 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 119 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 120 | *-*-linux*) |
| 121 | no_dev_ptmx=1 |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 122 | check_for_libcrypt_later=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 123 | AC_DEFINE(DONT_TRY_OTHER_AF) |
Damien Miller | 4e99720 | 2000-07-09 21:21:52 +1000 | [diff] [blame] | 124 | AC_DEFINE(PAM_TTY_KLUDGE) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 125 | inet6_default_4in6=yes |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 126 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 127 | mips-sony-bsd|mips-sony-newsos4) |
| 128 | AC_DEFINE(HAVE_NEWS4) |
| 129 | SONY=1 |
| 130 | AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT), |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 131 | AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 132 | ) |
| 133 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 134 | *-*-netbsd*) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 135 | need_dash_r=1 |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 136 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 137 | *-*-freebsd*) |
| 138 | check_for_libcrypt_later=1 |
| 139 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 140 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 141 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 142 | conf_utmp_location=/etc/utmp |
| 143 | conf_wtmp_location=/usr/adm/wtmp |
| 144 | MAIL=/usr/spool/mail |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 145 | AC_DEFINE(HAVE_NEXT) |
Ben Lindstrom | b4df15d | 2000-10-15 00:17:36 +0000 | [diff] [blame] | 146 | AC_DEFINE(BROKEN_REALPATH) |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 147 | AC_DEFINE(USE_PIPES) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 148 | AC_DEFINE(BROKEN_SAVED_UIDS) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 149 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Ben Lindstrom | 321ae73 | 2000-12-31 15:00:23 +0000 | [diff] [blame] | 150 | CFLAGS="$CFLAGS" |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 151 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 152 | *-*-solaris*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 153 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Ben Lindstrom | 866488b | 2001-02-20 18:22:38 +0000 | [diff] [blame] | 154 | LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 155 | need_dash_r=1 |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 156 | AC_DEFINE(PAM_SUN_CODEBASE) |
Ben Lindstrom | 97c677d | 2001-05-08 20:33:05 +0000 | [diff] [blame] | 157 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
| 158 | AC_DEFINE(LOGIN_NEEDS_TERM) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 159 | # hardwire lastlog location (can't detect it on some versions) |
| 160 | conf_lastlog_location="/var/adm/lastlog" |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 161 | AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) |
| 162 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 163 | if test "$sol2ver" -ge 8; then |
| 164 | AC_MSG_RESULT(yes) |
| 165 | AC_DEFINE(DISABLE_UTMP) |
| 166 | AC_DEFINE(DISABLE_WTMP) |
| 167 | else |
| 168 | AC_MSG_RESULT(no) |
| 169 | fi |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 170 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 171 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 172 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 173 | AC_CHECK_FUNCS(getpwanam) |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 174 | AC_DEFINE(PAM_SUN_CODEBASE) |
Damien Miller | 877d8ea | 2001-02-18 15:29:28 +1100 | [diff] [blame] | 175 | AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 176 | conf_utmp_location=/etc/utmp |
| 177 | conf_wtmp_location=/var/adm/wtmp |
| 178 | conf_lastlog_location=/var/adm/lastlog |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 179 | AC_DEFINE(USE_PIPES) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 180 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 181 | *-ncr-sysv*) |
| 182 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
| 183 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 184 | LIBS="$LIBS -lc89 -lnsl -lgen -lsocket" |
Ben Lindstrom | 3432834 | 2001-04-23 22:39:42 +0000 | [diff] [blame] | 185 | AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 186 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 187 | *-sni-sysv*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 188 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 189 | LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib" |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 190 | IPADDR_IN_DISPLAY=yes |
| 191 | AC_DEFINE(USE_PIPES) |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 192 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Kevin Steves | 52dd468 | 2001-03-08 18:26:57 +0000 | [diff] [blame] | 193 | AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) |
Damien Miller | b2dc28e | 2000-07-12 09:18:33 +1000 | [diff] [blame] | 194 | LIBS="$LIBS -lgen -lnsl -lucb" |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 195 | ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 196 | *-*-sysv4.2*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 197 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 198 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 199 | enable_suid_ssh=no |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 200 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 201 | ;; |
| 202 | *-*-sysv5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 203 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 204 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 205 | enable_suid_ssh=no |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 206 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 207 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 208 | *-*-sysv*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 209 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 210 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 211 | LIBS="$LIBS -lgen -lsocket" |
| 212 | ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 213 | *-*-sco3.2v4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 214 | CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 215 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 216 | LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 217 | rsh_path="/usr/bin/rcmd" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 218 | RANLIB=true |
| 219 | no_dev_ptmx=1 |
| 220 | AC_DEFINE(BROKEN_SYS_TERMIO_H) |
| 221 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 222 | AC_DEFINE(HAVE_SCO_PROTECTED_PW) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 223 | AC_DEFINE(DISABLE_SHADOW) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 224 | AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 225 | AC_DEFINE(BROKEN_SAVED_UIDS) |
Damien Miller | 217f567 | 2001-02-16 12:12:41 +1100 | [diff] [blame] | 226 | AC_CHECK_FUNCS(getluid setluid) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 227 | MANTYPE=man |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 228 | ;; |
| 229 | *-*-sco3.2v5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 230 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 231 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 232 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 233 | no_dev_ptmx=1 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 234 | rsh_path="/usr/bin/rcmd" |
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 | AC_DEFINE(HAVE_SCO_PROTECTED_PW) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 237 | AC_DEFINE(DISABLE_SHADOW) |
Ben Lindstrom | 42717bf | 2000-12-28 15:46:20 +0000 | [diff] [blame] | 238 | AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) |
Damien Miller | 217f567 | 2001-02-16 12:12:41 +1100 | [diff] [blame] | 239 | AC_CHECK_FUNCS(getluid setluid) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 240 | MANTYPE=man |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 241 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 242 | *-dec-osf*) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 243 | AC_MSG_CHECKING(for Digital Unix SIA) |
| 244 | no_osfsia="" |
| 245 | AC_ARG_WITH(osfsia, |
| 246 | [ --with-osfsia Enable Digital Unix SIA], |
| 247 | [ |
| 248 | if test "x$withval" = "xno" ; then |
| 249 | AC_MSG_RESULT(disabled) |
| 250 | no_osfsia=1 |
| 251 | fi |
| 252 | ], |
| 253 | ) |
| 254 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 255 | if test -f /etc/sia/matrix.conf; then |
| 256 | AC_MSG_RESULT(yes) |
| 257 | AC_DEFINE(HAVE_OSF_SIA) |
| 258 | AC_DEFINE(DISABLE_LOGIN) |
| 259 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
| 260 | else |
| 261 | AC_MSG_RESULT(no) |
| 262 | fi |
| 263 | fi |
| 264 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 265 | esac |
| 266 | |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 267 | # Allow user to specify flags |
| 268 | AC_ARG_WITH(cflags, |
| 269 | [ --with-cflags Specify additional flags to pass to compiler], |
| 270 | [ |
| 271 | if test "x$withval" != "xno" ; then |
| 272 | CFLAGS="$CFLAGS $withval" |
| 273 | fi |
| 274 | ] |
| 275 | ) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 276 | AC_ARG_WITH(cppflags, |
| 277 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 278 | [ |
| 279 | if test "x$withval" != "xno"; then |
| 280 | CPPFLAGS="$CPPFLAGS $withval" |
| 281 | fi |
| 282 | ] |
| 283 | ) |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 284 | AC_ARG_WITH(ldflags, |
Ben Lindstrom | 2ed9818 | 2000-11-06 07:15:43 +0000 | [diff] [blame] | 285 | [ --with-ldflags Specify additional flags to pass to linker], |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 286 | [ |
| 287 | if test "x$withval" != "xno" ; then |
| 288 | LDFLAGS="$LDFLAGS $withval" |
| 289 | fi |
| 290 | ] |
| 291 | ) |
| 292 | AC_ARG_WITH(libs, |
| 293 | [ --with-libs Specify additional libraries to link with], |
| 294 | [ |
| 295 | if test "x$withval" != "xno" ; then |
| 296 | LIBS="$LIBS $withval" |
| 297 | fi |
| 298 | ] |
| 299 | ) |
| 300 | |
Ben Lindstrom | 4e5a0aa | 2001-02-15 18:16:22 +0000 | [diff] [blame] | 301 | AC_ARG_WITH(pcre, |
| 302 | [ --with-pcre Override built in regex library with pcre], |
| 303 | [ |
| 304 | |
| 305 | AC_CHECK_LIB(pcre, pcre_info, |
| 306 | [ |
| 307 | AC_DEFINE(HAVE_LIBPCRE) |
| 308 | LIBS="$LIBS -lpcreposix -lpcre" |
| 309 | no_comp_check="yes" |
| 310 | ], |
| 311 | [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ] |
| 312 | ) |
| 313 | ] |
| 314 | ) |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 315 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 316 | # Checks for libraries. |
Damien Miller | 22d5aa7 | 2001-02-18 12:49:57 +1100 | [diff] [blame] | 317 | if test -z "$no_libnsl" ; then |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 318 | AC_CHECK_LIB(nsl, yp_match, , ) |
| 319 | fi |
Damien Miller | 22d5aa7 | 2001-02-18 12:49:57 +1100 | [diff] [blame] | 320 | if test -z "$no_libsocket" ; then |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 321 | AC_CHECK_LIB(socket, main, , ) |
| 322 | fi |
| 323 | |
Damien Miller | df28802 | 2001-02-18 13:07:07 +1100 | [diff] [blame] | 324 | dnl SCO OS3 needs this for libwrap |
| 325 | AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc) |
| 326 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 327 | AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen") |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 328 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 329 | AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil") |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 330 | |
Ben Lindstrom | 4e5a0aa | 2001-02-15 18:16:22 +0000 | [diff] [blame] | 331 | # We don't want to check if we did an pcre override. |
| 332 | if test -z "$no_comp_check" ; then |
| 333 | AC_CHECK_FUNC(regcomp, |
| 334 | [ AC_DEFINE(HAVE_REGCOMP)], |
| 335 | [ |
| 336 | AC_CHECK_LIB(pcre, pcre_info, |
| 337 | [ |
| 338 | AC_DEFINE(HAVE_LIBPCRE) |
| 339 | LIBS="$LIBS -lpcreposix -lpcre" |
| 340 | ], |
| 341 | [ |
| 342 | AC_MSG_ERROR([*** No regex library found.]) |
| 343 | ]) |
| 344 | ] |
| 345 | ) |
| 346 | fi |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 347 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 348 | dnl UnixWare 2.x |
| 349 | AC_CHECK_FUNC(strcasecmp, |
| 350 | [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ] |
| 351 | ) |
| 352 | AC_CHECK_FUNC(utimes, |
| 353 | [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ] |
| 354 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 355 | |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 356 | AC_FUNC_STRFTIME |
| 357 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 358 | # Checks for header files. |
Damien Miller | da2ed56 | 2001-04-25 22:50:18 +1000 | [diff] [blame] | 359 | AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h getopt.h glob.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h regex.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/queue.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stddef.h time.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 360 | |
| 361 | # Check for ALTDIRFUNC glob() extension |
| 362 | AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support) |
| 363 | AC_EGREP_CPP(FOUNDIT, |
| 364 | [ |
| 365 | #include <glob.h> |
| 366 | #ifdef GLOB_ALTDIRFUNC |
| 367 | FOUNDIT |
| 368 | #endif |
| 369 | ], |
| 370 | [ |
| 371 | AC_DEFINE(GLOB_HAS_ALTDIRFUNC) |
| 372 | AC_MSG_RESULT(yes) |
| 373 | ], |
| 374 | [ |
| 375 | AC_MSG_RESULT(no) |
| 376 | ] |
| 377 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 378 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 379 | # Check for g.gl_matchc glob() extension |
| 380 | AC_MSG_CHECKING(for gl_matchc field in glob_t) |
| 381 | AC_EGREP_CPP(FOUNDIT, |
| 382 | [ |
| 383 | #include <glob.h> |
| 384 | int main(void){glob_t g; g.gl_matchc = 1;} |
| 385 | ], |
| 386 | [ |
| 387 | AC_DEFINE(GLOB_HAS_GL_MATCHC) |
| 388 | AC_MSG_RESULT(yes) |
| 389 | ], |
| 390 | [ |
| 391 | AC_MSG_RESULT(no) |
| 392 | ] |
| 393 | ) |
| 394 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 395 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
| 396 | AC_TRY_RUN( |
| 397 | [ |
| 398 | #include <sys/types.h> |
| 399 | #include <dirent.h> |
| 400 | int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));} |
| 401 | ], |
| 402 | [AC_MSG_RESULT(yes)], |
| 403 | [ |
| 404 | AC_MSG_RESULT(no) |
| 405 | AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) |
| 406 | ] |
| 407 | ) |
| 408 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 409 | # Check whether user wants S/Key support |
| 410 | SKEY_MSG="no" |
| 411 | AC_ARG_WITH(skey, |
| 412 | [ --with-skey=PATH Enable S/Key support], |
| 413 | [ |
| 414 | if test "x$withval" != "xno" ; then |
| 415 | |
| 416 | if test "x$withval" != "xyes" ; then |
| 417 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 418 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 419 | fi |
| 420 | |
| 421 | AC_DEFINE(SKEY) |
| 422 | LIBS="-lskey $LIBS" |
| 423 | SKEY_MSG="yes" |
| 424 | |
| 425 | AC_CHECK_FUNC(skey_keyinfo, |
| 426 | [], |
| 427 | [ |
| 428 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 429 | ]) |
| 430 | fi |
| 431 | ] |
| 432 | ) |
| 433 | |
| 434 | # Check whether user wants TCP wrappers support |
| 435 | TCPW_MSG="no" |
| 436 | AC_ARG_WITH(tcp-wrappers, |
| 437 | [ --with-tcp-wrappers Enable tcpwrappers support], |
| 438 | [ |
| 439 | if test "x$withval" != "xno" ; then |
| 440 | saved_LIBS="$LIBS" |
| 441 | LIBS="-lwrap $LIBS" |
| 442 | AC_MSG_CHECKING(for libwrap) |
| 443 | AC_TRY_LINK( |
| 444 | [ |
| 445 | #include <tcpd.h> |
| 446 | int deny_severity = 0, allow_severity = 0; |
| 447 | ], |
| 448 | [hosts_access(0);], |
| 449 | [ |
| 450 | AC_MSG_RESULT(yes) |
| 451 | AC_DEFINE(LIBWRAP) |
| 452 | TCPW_MSG="yes" |
| 453 | ], |
| 454 | [ |
| 455 | AC_MSG_ERROR([*** libwrap missing]) |
| 456 | ] |
| 457 | ) |
| 458 | fi |
| 459 | ] |
| 460 | ) |
| 461 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 462 | dnl Checks for library functions. |
Tim Rice | 36fb6e5 | 2001-05-28 10:17:34 -0700 | [diff] [blame] | 463 | AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent getusershell glob inet_aton inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv setegid seteuid setlogin setproctitle setresgid setreuid setrlimit setsid setvbuf sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 464 | dnl Checks for time functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 465 | AC_CHECK_FUNCS(gettimeofday time) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 466 | dnl Checks for libutil functions |
Ben Lindstrom | e2fb8d3 | 2000-12-28 00:07:07 +0000 | [diff] [blame] | 467 | AC_CHECK_HEADERS(libutil.h) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 468 | AC_CHECK_FUNCS(login logout updwtmp logwtmp) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 469 | dnl Checks for utmp functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 470 | AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 471 | AC_CHECK_FUNCS(utmpname) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 472 | dnl Checks for utmpx functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 473 | AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 474 | AC_CHECK_FUNCS(setutxent utmpxname) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 475 | |
Damien Miller | 5fc8565 | 2000-07-09 23:53:07 +1000 | [diff] [blame] | 476 | AC_CHECK_FUNC(getuserattr, |
| 477 | [AC_DEFINE(HAVE_GETUSERATTR)], |
| 478 | [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])] |
| 479 | ) |
| 480 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 481 | AC_CHECK_FUNC(login, |
| 482 | [AC_DEFINE(HAVE_LOGIN)], |
| 483 | [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])] |
| 484 | ) |
| 485 | |
| 486 | AC_CHECK_FUNC(daemon, |
| 487 | [AC_DEFINE(HAVE_DAEMON)], |
| 488 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 489 | ) |
| 490 | |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 491 | AC_CHECK_FUNC(getpagesize, |
| 492 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 493 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 494 | ) |
| 495 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 496 | # Check for broken snprintf |
| 497 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 498 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
| 499 | AC_TRY_RUN( |
| 500 | [ |
| 501 | #include <stdio.h> |
| 502 | int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');} |
| 503 | ], |
| 504 | [AC_MSG_RESULT(yes)], |
| 505 | [ |
| 506 | AC_MSG_RESULT(no) |
| 507 | AC_DEFINE(BROKEN_SNPRINTF) |
| 508 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
| 509 | ] |
| 510 | ) |
| 511 | fi |
| 512 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 513 | AC_FUNC_GETPGRP |
| 514 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 515 | # Check for PAM libs |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 516 | PAM_MSG="no" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 517 | AC_ARG_WITH(pam, |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 518 | [ --with-pam Enable PAM support ], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 519 | [ |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 520 | if test "x$withval" != "xno" ; then |
| 521 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then |
| 522 | AC_MSG_ERROR([PAM headers not found]) |
| 523 | fi |
| 524 | |
| 525 | AC_CHECK_LIB(dl, dlopen, , ) |
| 526 | AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing])) |
| 527 | AC_CHECK_FUNCS(pam_getenvlist) |
| 528 | |
| 529 | disable_shadow=yes |
| 530 | PAM_MSG="yes" |
| 531 | |
| 532 | AC_DEFINE(USE_PAM) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 533 | fi |
| 534 | ] |
| 535 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 536 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 537 | # Check for older PAM |
| 538 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 539 | # Check PAM strerror arguments (old PAM) |
| 540 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 541 | AC_TRY_COMPILE( |
| 542 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 543 | #include <stdlib.h> |
| 544 | #include <security/pam_appl.h> |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 545 | ], |
| 546 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 547 | [AC_MSG_RESULT(no)], |
| 548 | [ |
| 549 | AC_DEFINE(HAVE_OLD_PAM) |
| 550 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 551 | PAM_MSG="yes (old library)" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 552 | ] |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 553 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 554 | fi |
| 555 | |
| 556 | # The big search for OpenSSL |
| 557 | AC_ARG_WITH(ssl-dir, |
| 558 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 559 | [ |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 560 | if test "x$withval" != "xno" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 561 | tryssldir=$withval |
| 562 | fi |
| 563 | ] |
| 564 | ) |
| 565 | |
| 566 | saved_LIBS="$LIBS" |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 567 | saved_LDFLAGS="$LDFLAGS" |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 568 | saved_CPPFLAGS="$CPPFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 569 | if test "x$prefix" != "xNONE" ; then |
| 570 | tryssldir="$tryssldir $prefix" |
| 571 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 572 | AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [ |
Damien Miller | a1b61e1 | 2000-09-16 17:02:16 +1100 | [diff] [blame] | 573 | for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 574 | CPPFLAGS="$saved_CPPFLAGS" |
| 575 | LDFLAGS="$saved_LDFLAGS" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 576 | LIBS="$saved_LIBS -lcrypto" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 577 | |
| 578 | # Skip directories if they don't exist |
| 579 | if test ! -z "$ssldir" -a ! -d "$ssldir" ; then |
| 580 | continue; |
| 581 | fi |
| 582 | if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then |
| 583 | # Try to use $ssldir/lib if it exists, otherwise |
| 584 | # $ssldir |
| 585 | if test -d "$ssldir/lib" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 586 | LDFLAGS="-L$ssldir/lib $saved_LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 587 | if test ! -z "$need_dash_r" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 588 | LDFLAGS="-R$ssldir/lib $LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 589 | fi |
| 590 | else |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 591 | LDFLAGS="-L$ssldir $saved_LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 592 | if test ! -z "$need_dash_r" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 593 | LDFLAGS="-R$ssldir $LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 594 | fi |
| 595 | fi |
| 596 | # Try to use $ssldir/include if it exists, otherwise |
| 597 | # $ssldir |
| 598 | if test -d "$ssldir/include" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 599 | CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 600 | else |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 601 | CPPFLAGS="-I$ssldir $saved_CPPFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 602 | fi |
| 603 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 604 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 605 | # Basic test to check for compatible version and correct linking |
| 606 | # *does not* test for RSA - that comes later. |
| 607 | AC_TRY_RUN( |
| 608 | [ |
Damien Miller | e59ce62 | 2000-05-01 20:54:17 +1000 | [diff] [blame] | 609 | #include <string.h> |
| 610 | #include <openssl/rand.h> |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 611 | int main(void) |
| 612 | { |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 613 | char a[2048]; |
| 614 | memset(a, 0, sizeof(a)); |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 615 | RAND_add(a, sizeof(a), sizeof(a)); |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 616 | return(RAND_status() <= 0); |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 617 | } |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 618 | ], |
| 619 | [ |
| 620 | found_crypto=1 |
| 621 | break; |
| 622 | ], [] |
| 623 | ) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 624 | |
| 625 | if test ! -z "$found_crypto" ; then |
| 626 | break; |
| 627 | fi |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 628 | done |
| 629 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 630 | if test -z "$found_crypto" ; then |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 631 | AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log]) |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 632 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 633 | if test -z "$ssldir" ; then |
| 634 | ssldir="(system)" |
| 635 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 636 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 637 | ac_cv_openssldir=$ssldir |
| 638 | ]) |
| 639 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 640 | if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 641 | AC_DEFINE(HAVE_OPENSSL) |
| 642 | dnl Need to recover ssldir - test above runs in subshell |
| 643 | ssldir=$ac_cv_openssldir |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 644 | if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 645 | # Try to use $ssldir/lib if it exists, otherwise |
| 646 | # $ssldir |
| 647 | if test -d "$ssldir/lib" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 648 | LDFLAGS="-L$ssldir/lib $saved_LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 649 | if test ! -z "$need_dash_r" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 650 | LDFLAGS="-R$ssldir/lib $LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 651 | fi |
| 652 | else |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 653 | LDFLAGS="-L$ssldir $saved_LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 654 | if test ! -z "$need_dash_r" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 655 | LDFLAGS="-R$ssldir $LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 656 | fi |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 657 | fi |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 658 | # Try to use $ssldir/include if it exists, otherwise |
| 659 | # $ssldir |
| 660 | if test -d "$ssldir/include" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 661 | CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 662 | else |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 663 | CPPFLAGS="-I$ssldir $saved_CPPFLAGS" |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 664 | fi |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 665 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 666 | fi |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 667 | LIBS="$saved_LIBS -lcrypto" |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 668 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 669 | # Now test RSA support |
| 670 | saved_LIBS="$LIBS" |
| 671 | AC_MSG_CHECKING([for RSA support]) |
| 672 | for WANTS_RSAREF in "" 1 ; do |
| 673 | if test -z "$WANTS_RSAREF" ; then |
| 674 | LIBS="$saved_LIBS" |
| 675 | else |
| 676 | LIBS="$saved_LIBS -lRSAglue -lrsaref" |
| 677 | fi |
| 678 | AC_TRY_RUN([ |
| 679 | #include <string.h> |
| 680 | #include <openssl/rand.h> |
| 681 | #include <openssl/rsa.h> |
| 682 | #include <openssl/bn.h> |
| 683 | #include <openssl/sha.h> |
| 684 | int main(void) |
| 685 | { |
| 686 | int num; RSA *key; static unsigned char p_in[] = "blahblah"; |
| 687 | unsigned char c[256], p[256]; |
| 688 | memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c)); |
| 689 | if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1); |
| 690 | num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING); |
| 691 | return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING)); |
| 692 | } |
| 693 | ], |
| 694 | [ |
| 695 | rsa_works=1 |
| 696 | break; |
| 697 | ], []) |
| 698 | done |
Ben Lindstrom | 23fec14 | 2001-06-09 02:16:28 +0000 | [diff] [blame] | 699 | LIBS="$saved_LIBS" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 700 | |
| 701 | if test ! -z "$no_rsa" ; then |
| 702 | AC_MSG_RESULT(disabled) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 703 | RSA_MSG="disabled" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 704 | else |
| 705 | if test -z "$rsa_works" ; then |
| 706 | AC_MSG_WARN([*** No RSA support found *** ]) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 707 | RSA_MSG="no" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 708 | else |
| 709 | if test -z "$WANTS_RSAREF" ; then |
| 710 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 711 | RSA_MSG="yes" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 712 | else |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 713 | RSA_MSG="yes (using RSAref)" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 714 | AC_MSG_RESULT(using RSAref) |
Ben Lindstrom | 23fec14 | 2001-06-09 02:16:28 +0000 | [diff] [blame] | 715 | LIBS="$LIBS -lcrypto -lRSAglue -lrsaref" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 716 | fi |
| 717 | fi |
| 718 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 719 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 720 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
| 721 | # version in OpenSSL. Skip this for PAM |
| 722 | 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] | 723 | AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 724 | fi |
| 725 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 726 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 727 | if test ! -z "$SONY" ; then |
| 728 | LIBS="$LIBS -liberty"; |
| 729 | fi |
| 730 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 731 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 732 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 733 | AC_CHECK_SIZEOF(short int, 2) |
| 734 | AC_CHECK_SIZEOF(int, 4) |
| 735 | AC_CHECK_SIZEOF(long int, 4) |
| 736 | AC_CHECK_SIZEOF(long long int, 8) |
| 737 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 738 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 739 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
| 740 | AC_TRY_COMPILE( |
| 741 | [ #include <sys/types.h> ], |
| 742 | [ u_int a; a = 1;], |
| 743 | [ ac_cv_have_u_int="yes" ], |
| 744 | [ ac_cv_have_u_int="no" ] |
| 745 | ) |
| 746 | ]) |
| 747 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
| 748 | AC_DEFINE(HAVE_U_INT) |
| 749 | have_u_int=1 |
| 750 | fi |
| 751 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 752 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
| 753 | AC_TRY_COMPILE( |
| 754 | [ #include <sys/types.h> ], |
| 755 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
| 756 | [ ac_cv_have_intxx_t="yes" ], |
| 757 | [ ac_cv_have_intxx_t="no" ] |
| 758 | ) |
| 759 | ]) |
| 760 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
| 761 | AC_DEFINE(HAVE_INTXX_T) |
| 762 | have_intxx_t=1 |
| 763 | fi |
| 764 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 765 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
| 766 | AC_TRY_COMPILE( |
| 767 | [ #include <sys/types.h> ], |
| 768 | [ int64_t a; a = 1;], |
| 769 | [ ac_cv_have_int64_t="yes" ], |
| 770 | [ ac_cv_have_int64_t="no" ] |
| 771 | ) |
| 772 | ]) |
| 773 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
| 774 | AC_DEFINE(HAVE_INT64_T) |
| 775 | have_int64_t=1 |
| 776 | fi |
| 777 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 778 | AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ |
| 779 | AC_TRY_COMPILE( |
| 780 | [ #include <sys/types.h> ], |
| 781 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
| 782 | [ ac_cv_have_u_intxx_t="yes" ], |
| 783 | [ ac_cv_have_u_intxx_t="no" ] |
| 784 | ) |
| 785 | ]) |
| 786 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
| 787 | AC_DEFINE(HAVE_U_INTXX_T) |
| 788 | have_u_intxx_t=1 |
| 789 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 790 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 791 | AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ |
| 792 | AC_TRY_COMPILE( |
| 793 | [ #include <sys/types.h> ], |
| 794 | [ u_int64_t a; a = 1;], |
| 795 | [ ac_cv_have_u_int64_t="yes" ], |
| 796 | [ ac_cv_have_u_int64_t="no" ] |
| 797 | ) |
| 798 | ]) |
| 799 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
| 800 | AC_DEFINE(HAVE_U_INT64_T) |
| 801 | have_u_int64_t=1 |
| 802 | fi |
| 803 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 804 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
| 805 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 806 | then |
| 807 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 808 | AC_TRY_COMPILE( |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 809 | [ |
| 810 | #include <sys/bitypes.h> |
| 811 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 812 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 813 | int8_t a; int16_t b; int32_t c; |
| 814 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 815 | a = b = c = e = f = g = 1; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 816 | ], |
| 817 | [ |
| 818 | AC_DEFINE(HAVE_U_INTXX_T) |
| 819 | AC_DEFINE(HAVE_INTXX_T) |
| 820 | AC_MSG_RESULT(yes) |
| 821 | ], |
| 822 | [AC_MSG_RESULT(no)] |
| 823 | ) |
| 824 | fi |
| 825 | |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 826 | if test -z "$have_u_intxx_t" ; then |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 827 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
| 828 | AC_TRY_COMPILE( |
| 829 | [ |
| 830 | #include <sys/types.h> |
| 831 | ], |
| 832 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], |
| 833 | [ ac_cv_have_uintxx_t="yes" ], |
| 834 | [ ac_cv_have_uintxx_t="no" ] |
| 835 | ) |
| 836 | ]) |
| 837 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
| 838 | AC_DEFINE(HAVE_UINTXX_T) |
| 839 | fi |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 840 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 841 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 842 | AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [ |
| 843 | AC_TRY_COMPILE( |
| 844 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 845 | #include <sys/types.h> |
| 846 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 847 | ], |
| 848 | [socklen_t foo; foo = 1235;], |
| 849 | [ ac_cv_have_socklen_t="yes" ], |
| 850 | [ ac_cv_have_socklen_t="no" ] |
| 851 | ) |
| 852 | ]) |
| 853 | if test "x$ac_cv_have_socklen_t" = "xyes" ; then |
| 854 | AC_DEFINE(HAVE_SOCKLEN_T) |
| 855 | fi |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 856 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 857 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
| 858 | AC_TRY_COMPILE( |
| 859 | [ |
| 860 | #include <sys/types.h> |
| 861 | ], |
| 862 | [ size_t foo; foo = 1235; ], |
| 863 | [ ac_cv_have_size_t="yes" ], |
| 864 | [ ac_cv_have_size_t="no" ] |
| 865 | ) |
| 866 | ]) |
| 867 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
| 868 | AC_DEFINE(HAVE_SIZE_T) |
| 869 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 870 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 871 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
| 872 | AC_TRY_COMPILE( |
| 873 | [ |
| 874 | #include <sys/types.h> |
| 875 | ], |
| 876 | [ ssize_t foo; foo = 1235; ], |
| 877 | [ ac_cv_have_ssize_t="yes" ], |
| 878 | [ ac_cv_have_ssize_t="no" ] |
| 879 | ) |
| 880 | ]) |
| 881 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
| 882 | AC_DEFINE(HAVE_SSIZE_T) |
| 883 | fi |
| 884 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 885 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
| 886 | AC_TRY_COMPILE( |
| 887 | [ |
| 888 | #include <time.h> |
| 889 | ], |
| 890 | [ clock_t foo; foo = 1235; ], |
| 891 | [ ac_cv_have_clock_t="yes" ], |
| 892 | [ ac_cv_have_clock_t="no" ] |
| 893 | ) |
| 894 | ]) |
| 895 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
| 896 | AC_DEFINE(HAVE_CLOCK_T) |
| 897 | fi |
| 898 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 899 | AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ |
| 900 | AC_TRY_COMPILE( |
| 901 | [ |
| 902 | #include <sys/types.h> |
| 903 | #include <sys/socket.h> |
| 904 | ], |
| 905 | [ sa_family_t foo; foo = 1235; ], |
| 906 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 907 | [ AC_TRY_COMPILE( |
| 908 | [ |
| 909 | #include <sys/types.h> |
| 910 | #include <sys/socket.h> |
| 911 | #include <netinet/in.h> |
| 912 | ], |
| 913 | [ sa_family_t foo; foo = 1235; ], |
| 914 | [ ac_cv_have_sa_family_t="yes" ], |
| 915 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 916 | [ ac_cv_have_sa_family_t="no" ] |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 917 | )] |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 918 | ) |
| 919 | ]) |
| 920 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
| 921 | AC_DEFINE(HAVE_SA_FAMILY_T) |
| 922 | fi |
| 923 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 924 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
| 925 | AC_TRY_COMPILE( |
| 926 | [ |
| 927 | #include <sys/types.h> |
| 928 | ], |
| 929 | [ pid_t foo; foo = 1235; ], |
| 930 | [ ac_cv_have_pid_t="yes" ], |
| 931 | [ ac_cv_have_pid_t="no" ] |
| 932 | ) |
| 933 | ]) |
| 934 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
| 935 | AC_DEFINE(HAVE_PID_T) |
| 936 | fi |
| 937 | |
| 938 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
| 939 | AC_TRY_COMPILE( |
| 940 | [ |
| 941 | #include <sys/types.h> |
| 942 | ], |
| 943 | [ mode_t foo; foo = 1235; ], |
| 944 | [ ac_cv_have_mode_t="yes" ], |
| 945 | [ ac_cv_have_mode_t="no" ] |
| 946 | ) |
| 947 | ]) |
| 948 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
| 949 | AC_DEFINE(HAVE_MODE_T) |
| 950 | fi |
| 951 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 952 | |
| 953 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
| 954 | AC_TRY_COMPILE( |
| 955 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 956 | #include <sys/types.h> |
| 957 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 958 | ], |
| 959 | [ struct sockaddr_storage s; ], |
| 960 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 961 | [ ac_cv_have_struct_sockaddr_storage="no" ] |
| 962 | ) |
| 963 | ]) |
| 964 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
| 965 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 966 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 967 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 968 | AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
| 969 | AC_TRY_COMPILE( |
| 970 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 971 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 972 | #include <netinet/in.h> |
| 973 | ], |
| 974 | [ struct sockaddr_in6 s; s.sin6_family = 0; ], |
| 975 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 976 | [ ac_cv_have_struct_sockaddr_in6="no" ] |
| 977 | ) |
| 978 | ]) |
| 979 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
| 980 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 981 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 982 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 983 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
| 984 | AC_TRY_COMPILE( |
| 985 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 986 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 987 | #include <netinet/in.h> |
| 988 | ], |
| 989 | [ struct in6_addr s; s.s6_addr[0] = 0; ], |
| 990 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 991 | [ ac_cv_have_struct_in6_addr="no" ] |
| 992 | ) |
| 993 | ]) |
| 994 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
| 995 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 996 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 997 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 998 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
| 999 | AC_TRY_COMPILE( |
| 1000 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1001 | #include <sys/types.h> |
| 1002 | #include <sys/socket.h> |
| 1003 | #include <netdb.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1004 | ], |
| 1005 | [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], |
| 1006 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 1007 | [ ac_cv_have_struct_addrinfo="no" ] |
| 1008 | ) |
| 1009 | ]) |
| 1010 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
| 1011 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 1012 | fi |
| 1013 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 1014 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
| 1015 | AC_TRY_COMPILE( |
| 1016 | [ #include <sys/time.h> ], |
| 1017 | [ struct timeval tv; tv.tv_sec = 1;], |
| 1018 | [ ac_cv_have_struct_timeval="yes" ], |
| 1019 | [ ac_cv_have_struct_timeval="no" ] |
| 1020 | ) |
| 1021 | ]) |
| 1022 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
| 1023 | AC_DEFINE(HAVE_STRUCT_TIMEVAL) |
| 1024 | have_struct_timeval=1 |
| 1025 | fi |
| 1026 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1027 | # If we don't have int64_t then we can't compile sftp-server. So don't |
| 1028 | # even attempt to do it. |
| 1029 | if test "x$ac_cv_have_int64_t" = "xno" -a \ |
| 1030 | "x$ac_cv_sizeof_long_int" != "x8" -a \ |
| 1031 | "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
| 1032 | NO_SFTP='#' |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 1033 | else |
| 1034 | dnl test snprintf (broken on SCO w/gcc) |
| 1035 | AC_TRY_RUN( |
| 1036 | [ |
| 1037 | #include <stdio.h> |
| 1038 | #include <string.h> |
| 1039 | #ifdef HAVE_SNPRINTF |
| 1040 | main() |
| 1041 | { |
| 1042 | char buf[50]; |
| 1043 | char expected_out[50]; |
| 1044 | int mazsize = 50 ; |
| 1045 | #if (SIZEOF_LONG_INT == 8) |
| 1046 | long int num = 0x7fffffffffffffff; |
| 1047 | #else |
| 1048 | long long num = 0x7fffffffffffffff; |
| 1049 | #endif |
| 1050 | strcpy(expected_out, "9223372036854775807"); |
| 1051 | snprintf(buf, mazsize, "%lld", num); |
| 1052 | if(strcmp(buf, expected_out) != 0) |
| 1053 | exit(1); |
| 1054 | exit(0); |
| 1055 | } |
| 1056 | #else |
| 1057 | main() { exit(0); } |
| 1058 | #endif |
| 1059 | ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ] |
| 1060 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1061 | fi |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 1062 | AC_SUBST(NO_SFTP) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1063 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1064 | dnl Checks for structure members |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1065 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) |
| 1066 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) |
| 1067 | OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) |
| 1068 | OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) |
| 1069 | 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] | 1070 | 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] | 1071 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) |
| 1072 | 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] | 1073 | 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] | 1074 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) |
| 1075 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) |
| 1076 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) |
| 1077 | 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] | 1078 | OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP) |
| 1079 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP) |
| 1080 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) |
| 1081 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1082 | AC_STRUCT_ST_BLKSIZE |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1083 | |
Damien Miller | 942da03 | 2000-08-18 13:59:06 +1000 | [diff] [blame] | 1084 | AC_CACHE_CHECK([for sun_len field in struct sockaddr_un], |
| 1085 | ac_cv_have_sun_len_in_struct_sockaddr_un, [ |
| 1086 | AC_TRY_COMPILE( |
| 1087 | [ |
| 1088 | #include <sys/types.h> |
| 1089 | #include <sys/socket.h> |
| 1090 | ], |
| 1091 | [ struct sockaddr_un s; s.sun_len = 1; ], |
| 1092 | [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ], |
| 1093 | [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ], |
| 1094 | ) |
| 1095 | ]) |
| 1096 | if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then |
| 1097 | AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN) |
| 1098 | fi |
| 1099 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1100 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 1101 | ac_cv_have_ss_family_in_struct_ss, [ |
| 1102 | AC_TRY_COMPILE( |
| 1103 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1104 | #include <sys/types.h> |
| 1105 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1106 | ], |
| 1107 | [ struct sockaddr_storage s; s.ss_family = 1; ], |
| 1108 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 1109 | [ ac_cv_have_ss_family_in_struct_ss="no" ], |
| 1110 | ) |
| 1111 | ]) |
| 1112 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
| 1113 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 1114 | fi |
| 1115 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1116 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 1117 | ac_cv_have___ss_family_in_struct_ss, [ |
| 1118 | AC_TRY_COMPILE( |
| 1119 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1120 | #include <sys/types.h> |
| 1121 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1122 | ], |
| 1123 | [ struct sockaddr_storage s; s.__ss_family = 1; ], |
| 1124 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 1125 | [ ac_cv_have___ss_family_in_struct_ss="no" ] |
| 1126 | ) |
| 1127 | ]) |
| 1128 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
| 1129 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 1130 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 1131 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1132 | AC_CACHE_CHECK([for pw_class field in struct passwd], |
| 1133 | ac_cv_have_pw_class_in_struct_passwd, [ |
| 1134 | AC_TRY_COMPILE( |
| 1135 | [ |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1136 | #include <pwd.h> |
| 1137 | ], |
Kevin Steves | 48b7cc0 | 2000-10-07 13:24:00 +0000 | [diff] [blame] | 1138 | [ struct passwd p; p.pw_class = 0; ], |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1139 | [ ac_cv_have_pw_class_in_struct_passwd="yes" ], |
| 1140 | [ ac_cv_have_pw_class_in_struct_passwd="no" ] |
| 1141 | ) |
| 1142 | ]) |
| 1143 | if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then |
| 1144 | AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD) |
| 1145 | fi |
| 1146 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1147 | |
| 1148 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
| 1149 | AC_TRY_LINK([], |
| 1150 | [ extern char *__progname; printf("%s", __progname); ], |
| 1151 | [ ac_cv_libc_defines___progname="yes" ], |
| 1152 | [ ac_cv_libc_defines___progname="no" ] |
| 1153 | ) |
| 1154 | ]) |
| 1155 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
| 1156 | AC_DEFINE(HAVE___PROGNAME) |
| 1157 | fi |
| 1158 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1159 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 1160 | AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ |
| 1161 | AC_TRY_LINK([], |
| 1162 | [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);], |
| 1163 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
| 1164 | [ ac_cv_libc_defines_sys_errlist="no" ] |
| 1165 | ) |
| 1166 | ]) |
| 1167 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
| 1168 | AC_DEFINE(HAVE_SYS_ERRLIST) |
| 1169 | fi |
| 1170 | |
| 1171 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 1172 | AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ |
| 1173 | AC_TRY_LINK([], |
| 1174 | [ extern int sys_nerr; printf("%i", sys_nerr);], |
| 1175 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
| 1176 | [ ac_cv_libc_defines_sys_nerr="no" ] |
| 1177 | ) |
| 1178 | ]) |
| 1179 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
| 1180 | AC_DEFINE(HAVE_SYS_NERR) |
| 1181 | fi |
| 1182 | |
| 1183 | |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1184 | # Check whether user wants Kerberos support |
| 1185 | KRB4_MSG="no" |
| 1186 | AC_ARG_WITH(kerberos4, |
| 1187 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
| 1188 | [ |
| 1189 | if test "x$withval" != "xno" ; then |
| 1190 | |
| 1191 | if test "x$withval" != "xyes" ; then |
| 1192 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1193 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1194 | if test ! -z "$need_dash_r" ; then |
| 1195 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
| 1196 | fi |
| 1197 | if test ! -z "$blibpath" ; then |
| 1198 | blibpath="$blibpath:${withval}/lib" |
| 1199 | fi |
| 1200 | else |
| 1201 | if test -d /usr/include/kerberosIV ; then |
| 1202 | CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV" |
| 1203 | fi |
| 1204 | fi |
| 1205 | |
| 1206 | AC_CHECK_HEADERS(krb.h) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1207 | if test "$ac_cv_header_krb_h" != yes; then |
| 1208 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 1209 | fi |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1210 | AC_CHECK_LIB(krb, main) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1211 | if test "$ac_cv_lib_krb_main" != yes; then |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1212 | AC_CHECK_LIB(krb4, main) |
| 1213 | if test "$ac_cv_lib_krb4_main" != yes; then |
| 1214 | AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail]) |
| 1215 | else |
| 1216 | KLIBS="-lkrb4" |
| 1217 | fi |
| 1218 | else |
| 1219 | KLIBS="-lkrb" |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1220 | fi |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1221 | AC_CHECK_LIB(des, des_cbc_encrypt) |
| 1222 | if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then |
| 1223 | AC_CHECK_LIB(des425, des_cbc_encrypt) |
| 1224 | if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then |
| 1225 | AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail]) |
| 1226 | else |
| 1227 | KLIBS="-ldes425" |
| 1228 | fi |
| 1229 | else |
| 1230 | KLIBS="-ldes" |
| 1231 | fi |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1232 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 1233 | KRB4=yes |
| 1234 | KRB4_MSG="yes" |
| 1235 | AC_DEFINE(KRB4) |
| 1236 | fi |
| 1237 | ] |
| 1238 | ) |
| 1239 | |
| 1240 | # Check whether user wants AFS support |
| 1241 | AFS_MSG="no" |
| 1242 | AC_ARG_WITH(afs, |
| 1243 | [ --with-afs=PATH Enable AFS support], |
| 1244 | [ |
| 1245 | if test "x$withval" != "xno" ; then |
| 1246 | |
| 1247 | if test "x$withval" != "xyes" ; then |
| 1248 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1249 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1250 | fi |
| 1251 | |
| 1252 | if test -z "$KRB4" ; then |
| 1253 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 1254 | fi |
| 1255 | |
| 1256 | LIBS="-lkafs $LIBS" |
| 1257 | if test ! -z "$AFS_LIBS" ; then |
| 1258 | LIBS="$LIBS $AFS_LIBS" |
| 1259 | fi |
| 1260 | AC_DEFINE(AFS) |
| 1261 | AFS_MSG="yes" |
| 1262 | fi |
| 1263 | ] |
| 1264 | ) |
| 1265 | LIBS="$LIBS $KLIBS" |
| 1266 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1267 | # Looking for programs, paths and files |
| 1268 | AC_ARG_WITH(rsh, |
| 1269 | [ --with-rsh=PATH Specify path to remote shell program ], |
| 1270 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 1271 | if test "x$withval" != "$no" ; then |
Damien Miller | 90dcc05 | 2000-07-08 10:17:40 +1000 | [diff] [blame] | 1272 | rsh_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1273 | fi |
| 1274 | ], |
| 1275 | [ |
| 1276 | AC_PATH_PROG(rsh_path, rsh) |
| 1277 | ] |
| 1278 | ) |
| 1279 | |
| 1280 | AC_ARG_WITH(xauth, |
| 1281 | [ --with-xauth=PATH Specify path to xauth program ], |
| 1282 | [ |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 1283 | if test "x$withval" != "xno" ; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1284 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1285 | fi |
| 1286 | ], |
| 1287 | [ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1288 | 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] | 1289 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1290 | xauth_path="/usr/openwin/bin/xauth" |
| 1291 | fi |
| 1292 | ] |
| 1293 | ) |
| 1294 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 1295 | if test -z "$xauth_path" ; then |
| 1296 | XAUTH_PATH="undefined" |
| 1297 | AC_SUBST(XAUTH_PATH) |
| 1298 | else |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1299 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 1300 | XAUTH_PATH=$xauth_path |
| 1301 | AC_SUBST(XAUTH_PATH) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1302 | fi |
| 1303 | if test ! -z "$rsh_path" ; then |
| 1304 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") |
| 1305 | fi |
| 1306 | |
| 1307 | # Check for mail directory (last resort if we cannot get it from headers) |
| 1308 | if test ! -z "$MAIL" ; then |
| 1309 | maildir=`dirname $MAIL` |
| 1310 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 1311 | fi |
| 1312 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1313 | if test -z "$no_dev_ptmx" ; then |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 1314 | AC_CHECK_FILE("/dev/ptmx", |
| 1315 | [ |
| 1316 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 1317 | have_dev_ptmx=1 |
| 1318 | ] |
| 1319 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1320 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 1321 | AC_CHECK_FILE("/dev/ptc", |
| 1322 | [ |
| 1323 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 1324 | have_dev_ptc=1 |
| 1325 | ] |
| 1326 | ) |
| 1327 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1328 | # Options from here on. Some of these are preset by platform above |
| 1329 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1330 | # Check for user-specified random device, otherwise check /dev/urandom |
| 1331 | AC_ARG_WITH(random, |
Damien Miller | 0736c4d | 2001-01-25 10:51:46 +1100 | [diff] [blame] | 1332 | [ --with-random=FILE read entropy from FILE (default=/dev/urandom)], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1333 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 1334 | if test "x$withval" != "xno" ; then |
| 1335 | RANDOM_POOL="$withval"; |
| 1336 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 1337 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1338 | ], |
| 1339 | [ |
| 1340 | # Check for random device |
| 1341 | AC_CHECK_FILE("/dev/urandom", |
| 1342 | [ |
| 1343 | RANDOM_POOL="/dev/urandom"; |
| 1344 | AC_SUBST(RANDOM_POOL) |
| 1345 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 1346 | ] |
| 1347 | ) |
| 1348 | ] |
| 1349 | ) |
| 1350 | |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1351 | # Check for PRNGD/EGD pool file |
| 1352 | AC_ARG_WITH(prngd-port, |
| 1353 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT], |
| 1354 | [ |
| 1355 | if test ! -z "$withval" -a "x$withval" != "xno" ; then |
| 1356 | PRNGD_PORT="$withval" |
| 1357 | AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT) |
| 1358 | fi |
| 1359 | ] |
| 1360 | ) |
| 1361 | |
| 1362 | # Check for PRNGD/EGD pool file |
| 1363 | AC_ARG_WITH(prngd-socket, |
| 1364 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1365 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 1366 | if test "x$withval" != "xno" ; then |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1367 | PRNGD_SOCKET="$withval" |
| 1368 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 1369 | fi |
Damien Miller | 0736c4d | 2001-01-25 10:51:46 +1100 | [diff] [blame] | 1370 | ], |
| 1371 | [ |
| 1372 | # Check for existing socket only if we don't have a random device already |
| 1373 | if test -z "$RANDOM_POOL" ; then |
| 1374 | AC_MSG_CHECKING(for PRNGD/EGD socket) |
| 1375 | # Insert other locations here |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 1376 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1377 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 1378 | PRNGD_SOCKET="$sock" |
| 1379 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
Damien Miller | 0736c4d | 2001-01-25 10:51:46 +1100 | [diff] [blame] | 1380 | break; |
| 1381 | fi |
| 1382 | done |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1383 | if test ! -z "$PRNGD_SOCKET" ; then |
| 1384 | AC_MSG_RESULT($PRNGD_SOCKET) |
Damien Miller | 4864e8f | 2001-02-08 10:07:08 +1100 | [diff] [blame] | 1385 | else |
| 1386 | AC_MSG_RESULT(not found) |
| 1387 | fi |
Damien Miller | 0736c4d | 2001-01-25 10:51:46 +1100 | [diff] [blame] | 1388 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1389 | ] |
| 1390 | ) |
| 1391 | |
Damien Miller | 0736c4d | 2001-01-25 10:51:46 +1100 | [diff] [blame] | 1392 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1393 | # detect pathnames for entropy gathering commands, if we need them |
| 1394 | INSTALL_SSH_PRNG_CMDS="" |
| 1395 | rm -f prng_commands |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1396 | if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 1397 | # Use these commands to collect entropy |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1398 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
| 1399 | OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) |
| 1400 | OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp) |
| 1401 | OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig) |
| 1402 | OSSH_PATH_ENTROPY_PROG(PROG_PS, ps) |
| 1403 | OSSH_PATH_ENTROPY_PROG(PROG_W, w) |
| 1404 | OSSH_PATH_ENTROPY_PROG(PROG_WHO, who) |
| 1405 | OSSH_PATH_ENTROPY_PROG(PROG_LAST, last) |
| 1406 | OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog) |
| 1407 | OSSH_PATH_ENTROPY_PROG(PROG_DF, df) |
| 1408 | OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) |
| 1409 | OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) |
| 1410 | OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) |
| 1411 | OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1412 | |
| 1413 | INSTALL_SSH_PRNG_CMDS="yes" |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 1414 | fi |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1415 | AC_SUBST(INSTALL_SSH_PRNG_CMDS) |
| 1416 | |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 1417 | |
Ben Lindstrom | 9841b0a | 2001-06-09 02:26:58 +0000 | [diff] [blame] | 1418 | AC_ARG_WITH(mantype, |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 1419 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1420 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 1421 | case "$withval" in |
| 1422 | man|cat|doc) |
| 1423 | MANTYPE=$withval |
| 1424 | ;; |
| 1425 | *) |
| 1426 | AC_MSG_ERROR(invalid man type: $withval) |
| 1427 | ;; |
| 1428 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1429 | ] |
| 1430 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1431 | if test -z "$MANTYPE"; then |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 1432 | AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1433 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 1434 | MANTYPE=doc |
| 1435 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 1436 | MANTYPE=man |
| 1437 | else |
| 1438 | MANTYPE=cat |
| 1439 | fi |
| 1440 | fi |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1441 | AC_SUBST(MANTYPE) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1442 | if test "$MANTYPE" = "doc"; then |
| 1443 | mansubdir=man; |
| 1444 | else |
| 1445 | mansubdir=$MANTYPE; |
| 1446 | fi |
| 1447 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1448 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1449 | # Check whether to enable MD5 passwords |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1450 | MD5_MSG="no" |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 1451 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 1452 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1453 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 1454 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1455 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1456 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1457 | fi |
| 1458 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 1459 | ) |
| 1460 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1461 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1462 | AC_ARG_WITH(shadow, |
| 1463 | [ --without-shadow Disable shadow password support], |
| 1464 | [ |
| 1465 | if test "x$withval" = "xno" ; then |
| 1466 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 1467 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1468 | fi |
| 1469 | ] |
| 1470 | ) |
| 1471 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 1472 | if test -z "$disable_shadow" ; then |
| 1473 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
| 1474 | AC_TRY_COMPILE( |
| 1475 | [ |
| 1476 | #include <sys/types.h> |
| 1477 | #include <shadow.h> |
| 1478 | struct spwd sp; |
| 1479 | ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ], |
| 1480 | [ sp_expire_available=yes ], [] |
| 1481 | ) |
| 1482 | |
| 1483 | if test "x$sp_expire_available" = "xyes" ; then |
| 1484 | AC_MSG_RESULT(yes) |
| 1485 | AC_DEFINE(HAS_SHADOW_EXPIRE) |
| 1486 | else |
| 1487 | AC_MSG_RESULT(no) |
| 1488 | fi |
| 1489 | fi |
| 1490 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1491 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 1492 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 1493 | DISPLAY_HACK_MSG="yes" |
| 1494 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 1495 | else |
| 1496 | DISPLAY_HACK_MSG="no" |
| 1497 | AC_ARG_WITH(ipaddr-display, |
| 1498 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 1499 | [ |
| 1500 | if test "x$withval" != "xno" ; then |
| 1501 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 1502 | DISPLAY_HACK_MSG="yes" |
| 1503 | fi |
| 1504 | ] |
| 1505 | ) |
| 1506 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1507 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1508 | # Whether to mess with the default path |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1509 | SERVER_PATH_MSG="(default)" |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 1510 | AC_ARG_WITH(default-path, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1511 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 1512 | [ |
| 1513 | if test "x$withval" != "xno" ; then |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1514 | user_path="$withval" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1515 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1516 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1517 | ], |
| 1518 | [ |
| 1519 | AC_TRY_RUN( |
| 1520 | [ |
| 1521 | /* find out what STDPATH is */ |
| 1522 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1523 | #ifdef HAVE_PATHS_H |
| 1524 | # include <paths.h> |
| 1525 | #endif |
| 1526 | #ifndef _PATH_STDPATH |
| 1527 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 1528 | #endif |
| 1529 | #include <sys/types.h> |
| 1530 | #include <sys/stat.h> |
| 1531 | #include <fcntl.h> |
| 1532 | #define DATA "conftest.stdpath" |
| 1533 | |
| 1534 | main() |
| 1535 | { |
| 1536 | FILE *fd; |
| 1537 | int rc; |
| 1538 | |
| 1539 | fd = fopen(DATA,"w"); |
| 1540 | if(fd == NULL) |
| 1541 | exit(1); |
| 1542 | |
| 1543 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 1544 | exit(1); |
| 1545 | |
| 1546 | exit(0); |
| 1547 | } |
| 1548 | ], [ user_path=`cat conftest.stdpath` ], |
| 1549 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 1550 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 1551 | ) |
| 1552 | # make sure $bindir is in USER_PATH so scp will work |
| 1553 | t_bindir=`eval echo ${bindir}` |
| 1554 | case $t_bindir in |
| 1555 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 1556 | esac |
| 1557 | case $t_bindir in |
| 1558 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 1559 | esac |
| 1560 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 1561 | if test $? -ne 0 ; then |
| 1562 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 1563 | if test $? -ne 0 ; then |
| 1564 | user_path=$user_path:$t_bindir |
| 1565 | AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work) |
| 1566 | fi |
| 1567 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1568 | ] |
| 1569 | ) |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1570 | AC_DEFINE_UNQUOTED(USER_PATH, "$user_path") |
| 1571 | AC_SUBST(user_path) |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1572 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1573 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1574 | IPV4_HACK_MSG="no" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 1575 | AC_ARG_WITH(ipv4-default, |
| 1576 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 1577 | [ |
| 1578 | if test "x$withval" != "xno" ; then |
| 1579 | AC_DEFINE(IPV4_DEFAULT) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1580 | IPV4_HACK_MSG="yes" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 1581 | fi |
| 1582 | ] |
| 1583 | ) |
| 1584 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1585 | 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] | 1586 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1587 | AC_ARG_WITH(4in6, |
| 1588 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 1589 | [ |
| 1590 | if test "x$withval" != "xno" ; then |
| 1591 | AC_MSG_RESULT(yes) |
| 1592 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1593 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1594 | else |
| 1595 | AC_MSG_RESULT(no) |
| 1596 | fi |
| 1597 | ],[ |
| 1598 | if test "x$inet6_default_4in6" = "xyes"; then |
| 1599 | AC_MSG_RESULT([yes (default)]) |
| 1600 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1601 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1602 | else |
| 1603 | AC_MSG_RESULT([no (default)]) |
| 1604 | fi |
| 1605 | ] |
| 1606 | ) |
| 1607 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 1608 | # Whether to enable BSD auth support |
| 1609 | AC_ARG_WITH(bsd-auth, |
| 1610 | [ --with-bsd-auth Enable BSD auth support], |
| 1611 | [ |
| 1612 | if test "x$withval" != "xno" ; then |
| 1613 | AC_DEFINE(BSD_AUTH) |
| 1614 | bsd_auth=yes |
| 1615 | fi |
| 1616 | ] |
| 1617 | ) |
| 1618 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1619 | AC_MSG_CHECKING(whether to install ssh as suid root) |
| 1620 | AC_ARG_ENABLE(suid-ssh, |
| 1621 | [ --enable-suid-ssh Install ssh as suid root (default) |
| 1622 | --disable-suid-ssh Install ssh without suid bit], |
| 1623 | [ case "$enableval" in |
| 1624 | no) |
| 1625 | AC_MSG_RESULT(no) |
| 1626 | SSHMODE=0711 |
| 1627 | ;; |
| 1628 | *) AC_MSG_RESULT(yes) |
| 1629 | SSHMODE=04711 |
| 1630 | ;; |
| 1631 | esac ], |
| 1632 | AC_MSG_RESULT(yes) |
| 1633 | SSHMODE=04711 |
| 1634 | ) |
| 1635 | AC_SUBST(SSHMODE) |
| 1636 | |
| 1637 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1638 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1639 | piddir=/var/run |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1640 | AC_ARG_WITH(pid-dir, |
| 1641 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 1642 | [ |
| 1643 | if test "x$withval" != "xno" ; then |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1644 | piddir=$withval |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1645 | fi |
| 1646 | ] |
| 1647 | ) |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1648 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1649 | # make sure the directory exists |
| 1650 | if test ! -d $piddir ; then |
| 1651 | piddir=`eval echo ${sysconfdir}` |
| 1652 | case $piddir in |
| 1653 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 1654 | esac |
| 1655 | fi |
| 1656 | |
Ben Lindstrom | 226cfa0 | 2001-01-22 05:34:40 +0000 | [diff] [blame] | 1657 | AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1658 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1659 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1660 | dnl allow user to disable some login recording features |
| 1661 | AC_ARG_ENABLE(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1662 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1663 | [ AC_DEFINE(DISABLE_LASTLOG) ] |
| 1664 | ) |
| 1665 | AC_ARG_ENABLE(utmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1666 | [ --disable-utmp disable use of utmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1667 | [ AC_DEFINE(DISABLE_UTMP) ] |
| 1668 | ) |
| 1669 | AC_ARG_ENABLE(utmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1670 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1671 | [ AC_DEFINE(DISABLE_UTMPX) ] |
| 1672 | ) |
| 1673 | AC_ARG_ENABLE(wtmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1674 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1675 | [ AC_DEFINE(DISABLE_WTMP) ] |
| 1676 | ) |
| 1677 | AC_ARG_ENABLE(wtmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1678 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1679 | [ AC_DEFINE(DISABLE_WTMPX) ] |
| 1680 | ) |
| 1681 | AC_ARG_ENABLE(libutil, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1682 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1683 | [ AC_DEFINE(DISABLE_LOGIN) ] |
| 1684 | ) |
| 1685 | AC_ARG_ENABLE(pututline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1686 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1687 | [ AC_DEFINE(DISABLE_PUTUTLINE) ] |
| 1688 | ) |
| 1689 | AC_ARG_ENABLE(pututxline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1690 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1691 | [ AC_DEFINE(DISABLE_PUTUTXLINE) ] |
| 1692 | ) |
| 1693 | AC_ARG_WITH(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1694 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 1695 | [ |
| 1696 | if test "x$withval" = "xno" ; then |
| 1697 | AC_DEFINE(DISABLE_LASTLOG) |
| 1698 | else |
| 1699 | conf_lastlog_location=$withval |
| 1700 | fi |
| 1701 | ] |
| 1702 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1703 | |
| 1704 | dnl lastlog, [uw]tmpx? detection |
| 1705 | dnl NOTE: set the paths in the platform section to avoid the |
| 1706 | dnl need for command-line parameters |
| 1707 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 1708 | |
| 1709 | dnl lastlog detection |
| 1710 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 1711 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
| 1712 | AC_TRY_COMPILE([ |
| 1713 | #include <sys/types.h> |
| 1714 | #include <utmp.h> |
| 1715 | #ifdef HAVE_LASTLOG_H |
| 1716 | # include <lastlog.h> |
| 1717 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1718 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1719 | # include <paths.h> |
| 1720 | #endif |
| 1721 | ], |
| 1722 | [ char *lastlog = LASTLOG_FILE; ], |
| 1723 | [ AC_MSG_RESULT(yes) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1724 | [ |
| 1725 | AC_MSG_RESULT(no) |
| 1726 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
| 1727 | AC_TRY_COMPILE([ |
| 1728 | #include <sys/types.h> |
| 1729 | #include <utmp.h> |
| 1730 | #ifdef HAVE_LASTLOG_H |
| 1731 | # include <lastlog.h> |
| 1732 | #endif |
| 1733 | #ifdef HAVE_PATHS_H |
| 1734 | # include <paths.h> |
| 1735 | #endif |
| 1736 | ], |
| 1737 | [ char *lastlog = _PATH_LASTLOG; ], |
| 1738 | [ AC_MSG_RESULT(yes) ], |
| 1739 | [ |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 1740 | AC_MSG_RESULT(no) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1741 | system_lastlog_path=no |
| 1742 | ]) |
| 1743 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1744 | ) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1745 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1746 | if test -z "$conf_lastlog_location"; then |
| 1747 | if test x"$system_lastlog_path" = x"no" ; then |
| 1748 | 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] | 1749 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1750 | conf_lastlog_location=$f |
| 1751 | fi |
| 1752 | done |
| 1753 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 1754 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 1755 | 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] | 1756 | fi |
| 1757 | fi |
| 1758 | fi |
| 1759 | |
| 1760 | if test -n "$conf_lastlog_location"; then |
| 1761 | AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location") |
| 1762 | fi |
| 1763 | |
| 1764 | dnl utmp detection |
| 1765 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
| 1766 | AC_TRY_COMPILE([ |
| 1767 | #include <sys/types.h> |
| 1768 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1769 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1770 | # include <paths.h> |
| 1771 | #endif |
| 1772 | ], |
| 1773 | [ char *utmp = UTMP_FILE; ], |
| 1774 | [ AC_MSG_RESULT(yes) ], |
| 1775 | [ AC_MSG_RESULT(no) |
| 1776 | system_utmp_path=no ] |
| 1777 | ) |
| 1778 | if test -z "$conf_utmp_location"; then |
| 1779 | if test x"$system_utmp_path" = x"no" ; then |
| 1780 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 1781 | if test -f $f ; then |
| 1782 | conf_utmp_location=$f |
| 1783 | fi |
| 1784 | done |
| 1785 | if test -z "$conf_utmp_location"; then |
| 1786 | AC_DEFINE(DISABLE_UTMP) |
| 1787 | fi |
| 1788 | fi |
| 1789 | fi |
| 1790 | if test -n "$conf_utmp_location"; then |
| 1791 | AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location") |
| 1792 | fi |
| 1793 | |
| 1794 | dnl wtmp detection |
| 1795 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
| 1796 | AC_TRY_COMPILE([ |
| 1797 | #include <sys/types.h> |
| 1798 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1799 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1800 | # include <paths.h> |
| 1801 | #endif |
| 1802 | ], |
| 1803 | [ char *wtmp = WTMP_FILE; ], |
| 1804 | [ AC_MSG_RESULT(yes) ], |
| 1805 | [ AC_MSG_RESULT(no) |
| 1806 | system_wtmp_path=no ] |
| 1807 | ) |
| 1808 | if test -z "$conf_wtmp_location"; then |
| 1809 | if test x"$system_wtmp_path" = x"no" ; then |
| 1810 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 1811 | if test -f $f ; then |
| 1812 | conf_wtmp_location=$f |
| 1813 | fi |
| 1814 | done |
| 1815 | if test -z "$conf_wtmp_location"; then |
| 1816 | AC_DEFINE(DISABLE_WTMP) |
| 1817 | fi |
| 1818 | fi |
| 1819 | fi |
| 1820 | if test -n "$conf_wtmp_location"; then |
| 1821 | AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location") |
| 1822 | fi |
| 1823 | |
| 1824 | |
| 1825 | dnl utmpx detection - I don't know any system so perverse as to require |
| 1826 | dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out |
| 1827 | dnl there, though. |
| 1828 | AC_MSG_CHECKING([if your system defines UTMPX_FILE]) |
| 1829 | AC_TRY_COMPILE([ |
| 1830 | #include <sys/types.h> |
| 1831 | #include <utmp.h> |
| 1832 | #ifdef HAVE_UTMPX_H |
| 1833 | #include <utmpx.h> |
| 1834 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1835 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1836 | # include <paths.h> |
| 1837 | #endif |
| 1838 | ], |
| 1839 | [ char *utmpx = UTMPX_FILE; ], |
| 1840 | [ AC_MSG_RESULT(yes) ], |
| 1841 | [ AC_MSG_RESULT(no) |
| 1842 | system_utmpx_path=no ] |
| 1843 | ) |
| 1844 | if test -z "$conf_utmpx_location"; then |
| 1845 | if test x"$system_utmpx_path" = x"no" ; then |
| 1846 | AC_DEFINE(DISABLE_UTMPX) |
| 1847 | fi |
| 1848 | else |
| 1849 | AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location") |
| 1850 | fi |
| 1851 | |
| 1852 | dnl wtmpx detection |
| 1853 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
| 1854 | AC_TRY_COMPILE([ |
| 1855 | #include <sys/types.h> |
| 1856 | #include <utmp.h> |
| 1857 | #ifdef HAVE_UTMPX_H |
| 1858 | #include <utmpx.h> |
| 1859 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1860 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1861 | # include <paths.h> |
| 1862 | #endif |
| 1863 | ], |
| 1864 | [ char *wtmpx = WTMPX_FILE; ], |
| 1865 | [ AC_MSG_RESULT(yes) ], |
| 1866 | [ AC_MSG_RESULT(no) |
| 1867 | system_wtmpx_path=no ] |
| 1868 | ) |
| 1869 | if test -z "$conf_wtmpx_location"; then |
| 1870 | if test x"$system_wtmpx_path" = x"no" ; then |
| 1871 | AC_DEFINE(DISABLE_WTMPX) |
| 1872 | fi |
| 1873 | else |
| 1874 | AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location") |
| 1875 | fi |
| 1876 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1877 | |
| 1878 | # Change default command timeout for builtin PRNG |
Damien Miller | 14c12cb | 2000-06-07 22:20:23 +1000 | [diff] [blame] | 1879 | entropy_timeout=200 |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1880 | AC_ARG_WITH(entropy-timeout, |
| 1881 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 1882 | [ |
| 1883 | if test "x$withval" != "xno" ; then |
| 1884 | entropy_timeout=$withval |
| 1885 | fi |
| 1886 | ] |
| 1887 | ) |
| 1888 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) |
| 1889 | |
| 1890 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 1891 | if test ! -z "$blibpath" ; then |
| 1892 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 1893 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 1894 | fi |
| 1895 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 1896 | AC_EXEEXT |
| 1897 | |
Ben Lindstrom | 3c06f6a | 2001-01-31 21:52:01 +0000 | [diff] [blame] | 1898 | AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds) |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1899 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1900 | # Print summary of options |
| 1901 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1902 | if test ! -z "$RANDOM_POOL" ; then |
| 1903 | RAND_MSG="Device ($RANDOM_POOL)" |
| 1904 | else |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1905 | if test ! -z "$PRNGD_PORT" ; then |
| 1906 | RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)" |
| 1907 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 1908 | RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1909 | else |
| 1910 | RAND_MSG="Builtin (timeout $entropy_timeout)" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1911 | BUILTIN_RNG=1 |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1912 | fi |
| 1913 | fi |
| 1914 | |
| 1915 | # Someone please show me a better way :) |
| 1916 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 1917 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 1918 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 1919 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 1920 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1921 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1922 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1923 | H=`eval echo ${user_path}` ; H=`eval echo ${H}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1924 | |
| 1925 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 1926 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1927 | echo " User binaries: $B" |
| 1928 | echo " System binaries: $C" |
| 1929 | echo " Configuration files: $D" |
| 1930 | echo " Askpass program: $E" |
| 1931 | echo " Manual pages: $F" |
| 1932 | echo " PID file: $G" |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1933 | echo " sshd default user PATH: $H" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1934 | echo " Random number collection: $RAND_MSG" |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 1935 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1936 | echo " PAM support: ${PAM_MSG}" |
| 1937 | echo " KerberosIV support: $KRB4_MSG" |
| 1938 | echo " AFS support: $AFS_MSG" |
| 1939 | echo " S/KEY support: $SKEY_MSG" |
| 1940 | echo " TCP Wrappers support: $TCPW_MSG" |
| 1941 | echo " MD5 password support: $MD5_MSG" |
| 1942 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
| 1943 | echo " Use IPv4 by default hack: $IPV4_HACK_MSG" |
| 1944 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 1945 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 1946 | if test ! -z "$bsd_auth"; then |
| 1947 | echo " BSD Auth support: yes" |
| 1948 | fi |
| 1949 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1950 | echo "" |
| 1951 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 1952 | echo " Host: ${host}" |
| 1953 | echo " Compiler: ${CC}" |
| 1954 | echo " Compiler flags: ${CFLAGS}" |
| 1955 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 1956 | echo " Linker flags: ${LDFLAGS}" |
| 1957 | echo " Libraries: ${LIBS}" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1958 | |
| 1959 | echo "" |
| 1960 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 1961 | if test "x$PAM_MSG" = "xyes" ; then |
| 1962 | echo "PAM is enabled. You may need to install a PAM control file for sshd," |
| 1963 | echo "otherwise password authentication may fail. Example PAM control files" |
| 1964 | echo "can be found in the contrib/ subdirectory" |
| 1965 | echo "" |
| 1966 | fi |
| 1967 | |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1968 | if test ! -z "$BUILTIN_RNG" ; then |
| 1969 | echo "WARNING: you are using the builtin random number collection service." |
| 1970 | echo "Please read WARNING.RNG and request that your OS vendor includes" |
| 1971 | echo "/dev/random in future versions of their OS." |
| 1972 | echo "" |
| 1973 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1974 | |
| 1975 | if test ! -z "$NO_SFTP"; then |
| 1976 | echo "sftp-server will be disabled. Your compiler does not support" |
| 1977 | echo "64bit integers." |
| 1978 | echo "" |
| 1979 | fi |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 1980 | |