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