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